One Hat Cyber Team
Your IP:
216.73.216.102
Server IP:
198.54.114.155
Server:
Linux server71.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
Server Software:
LiteSpeed
PHP Version:
5.6.40
Create File
|
Create Folder
Execute
Dir :
~
/
home
/
fluxyjvi
/
public_html
/
assets
/
images
/
View File Name :
Rest.tar
Bulkexports.php 0000644 00000006503 15107452320 0007602 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Bulkexports\V1; /** * @property \Twilio\Rest\Bulkexports\V1 $v1 * @property \Twilio\Rest\Bulkexports\V1\ExportList $exports * @property \Twilio\Rest\Bulkexports\V1\ExportConfigurationList $exportConfiguration * @method \Twilio\Rest\Bulkexports\V1\ExportContext exports(string $resourceType) * @method \Twilio\Rest\Bulkexports\V1\ExportConfigurationContext exportConfiguration(string $resourceType) */ class Bulkexports extends Domain { protected $_v1; /** * Construct the Bulkexports Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->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); } protected function getExports(): \Twilio\Rest\Bulkexports\V1\ExportList { return $this->v1->exports; } /** * @param string $resourceType The type of communication – Messages, Calls, * Conferences, and Participants */ protected function contextExports(string $resourceType): \Twilio\Rest\Bulkexports\V1\ExportContext { return $this->v1->exports($resourceType); } protected function getExportConfiguration(): \Twilio\Rest\Bulkexports\V1\ExportConfigurationList { return $this->v1->exportConfiguration; } /** * @param string $resourceType The type of communication – Messages, Calls, * Conferences, and Participants */ protected function contextExportConfiguration(string $resourceType): \Twilio\Rest\Bulkexports\V1\ExportConfigurationContext { return $this->v1->exportConfiguration($resourceType); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Bulkexports]'; } } Taskrouter/V1/WorkspaceContext.php 0000644 00000022022 15107452320 0013206 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Taskrouter\V1\Workspace\ActivityList; use Twilio\Rest\Taskrouter\V1\Workspace\EventList; use Twilio\Rest\Taskrouter\V1\Workspace\TaskChannelList; use Twilio\Rest\Taskrouter\V1\Workspace\TaskList; use Twilio\Rest\Taskrouter\V1\Workspace\TaskQueueList; use Twilio\Rest\Taskrouter\V1\Workspace\WorkerList; use Twilio\Rest\Taskrouter\V1\Workspace\WorkflowList; use Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceCumulativeStatisticsList; use Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceRealTimeStatisticsList; use Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceStatisticsList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property ActivityList $activities * @property EventList $events * @property TaskList $tasks * @property TaskQueueList $taskQueues * @property WorkerList $workers * @property WorkflowList $workflows * @property WorkspaceStatisticsList $statistics * @property WorkspaceRealTimeStatisticsList $realTimeStatistics * @property WorkspaceCumulativeStatisticsList $cumulativeStatistics * @property TaskChannelList $taskChannels * @method \Twilio\Rest\Taskrouter\V1\Workspace\ActivityContext activities(string $sid) * @method \Twilio\Rest\Taskrouter\V1\Workspace\EventContext events(string $sid) * @method \Twilio\Rest\Taskrouter\V1\Workspace\TaskContext tasks(string $sid) * @method \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueueContext taskQueues(string $sid) * @method \Twilio\Rest\Taskrouter\V1\Workspace\WorkerContext workers(string $sid) * @method \Twilio\Rest\Taskrouter\V1\Workspace\WorkflowContext workflows(string $sid) * @method \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceStatisticsContext statistics() * @method \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceRealTimeStatisticsContext realTimeStatistics() * @method \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceCumulativeStatisticsContext cumulativeStatistics() * @method \Twilio\Rest\Taskrouter\V1\Workspace\TaskChannelContext taskChannels(string $sid) */ class WorkspaceContext extends InstanceContext { protected $_activities; protected $_events; protected $_tasks; protected $_taskQueues; protected $_workers; protected $_workflows; protected $_statistics; protected $_realTimeStatistics; protected $_cumulativeStatistics; protected $_taskChannels; /** * Initialize the WorkspaceContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the resource to fetch */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Workspaces/' . \rawurlencode($sid) . ''; } /** * Fetch the WorkspaceInstance * * @return WorkspaceInstance Fetched WorkspaceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WorkspaceInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new WorkspaceInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the WorkspaceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Access the activities */ protected function getActivities(): ActivityList { if (!$this->_activities) { $this->_activities = new ActivityList($this->version, $this->solution['sid']); } return $this->_activities; } /** * Access the events */ protected function getEvents(): EventList { if (!$this->_events) { $this->_events = new EventList($this->version, $this->solution['sid']); } return $this->_events; } /** * Access the tasks */ protected function getTasks(): TaskList { if (!$this->_tasks) { $this->_tasks = new TaskList($this->version, $this->solution['sid']); } return $this->_tasks; } /** * Access the taskQueues */ protected function getTaskQueues(): TaskQueueList { if (!$this->_taskQueues) { $this->_taskQueues = new TaskQueueList($this->version, $this->solution['sid']); } return $this->_taskQueues; } /** * 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 statistics */ protected function getStatistics(): WorkspaceStatisticsList { if (!$this->_statistics) { $this->_statistics = new WorkspaceStatisticsList($this->version, $this->solution['sid']); } return $this->_statistics; } /** * Access the realTimeStatistics */ protected function getRealTimeStatistics(): WorkspaceRealTimeStatisticsList { if (!$this->_realTimeStatistics) { $this->_realTimeStatistics = new WorkspaceRealTimeStatisticsList( $this->version, $this->solution['sid'] ); } return $this->_realTimeStatistics; } /** * Access the cumulativeStatistics */ protected function getCumulativeStatistics(): WorkspaceCumulativeStatisticsList { if (!$this->_cumulativeStatistics) { $this->_cumulativeStatistics = new WorkspaceCumulativeStatisticsList( $this->version, $this->solution['sid'] ); } return $this->_cumulativeStatistics; } /** * Access the taskChannels */ protected function getTaskChannels(): TaskChannelList { if (!$this->_taskChannels) { $this->_taskChannels = new TaskChannelList($this->version, $this->solution['sid']); } return $this->_taskChannels; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return 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) . ']'; } } Taskrouter/V1/WorkspacePage.php 0000644 00000002221 15107452320 0012435 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class WorkspacePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Taskrouter/V1/WorkspaceInstance.php 0000644 00000016360 15107452320 0013336 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Taskrouter\V1\Workspace\ActivityList; use Twilio\Rest\Taskrouter\V1\Workspace\EventList; use Twilio\Rest\Taskrouter\V1\Workspace\TaskChannelList; use Twilio\Rest\Taskrouter\V1\Workspace\TaskList; use Twilio\Rest\Taskrouter\V1\Workspace\TaskQueueList; use Twilio\Rest\Taskrouter\V1\Workspace\WorkerList; use Twilio\Rest\Taskrouter\V1\Workspace\WorkflowList; use Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceCumulativeStatisticsList; use Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceRealTimeStatisticsList; use Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceStatisticsList; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $defaultActivityName * @property string $defaultActivitySid * @property string $eventCallbackUrl * @property string $eventsFilter * @property string $friendlyName * @property bool $multiTaskEnabled * @property string $sid * @property string $timeoutActivityName * @property string $timeoutActivitySid * @property string $prioritizeQueueOrder * @property string $url * @property array $links */ class WorkspaceInstance extends InstanceResource { protected $_activities; protected $_events; protected $_tasks; protected $_taskQueues; protected $_workers; protected $_workflows; protected $_statistics; protected $_realTimeStatistics; protected $_cumulativeStatistics; protected $_taskChannels; /** * Initialize the WorkspaceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the resource to fetch */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Access the activities */ protected function getActivities(): ActivityList { return $this->proxy()->activities; } /** * Access the events */ protected function getEvents(): EventList { return $this->proxy()->events; } /** * Access the tasks */ protected function getTasks(): TaskList { return $this->proxy()->tasks; } /** * Access the taskQueues */ protected function getTaskQueues(): TaskQueueList { return $this->proxy()->taskQueues; } /** * Access the workers */ protected function getWorkers(): WorkerList { return $this->proxy()->workers; } /** * Access the workflows */ protected function getWorkflows(): WorkflowList { return $this->proxy()->workflows; } /** * Access the statistics */ protected function getStatistics(): WorkspaceStatisticsList { return $this->proxy()->statistics; } /** * Access the realTimeStatistics */ protected function getRealTimeStatistics(): WorkspaceRealTimeStatisticsList { return $this->proxy()->realTimeStatistics; } /** * Access the cumulativeStatistics */ protected function getCumulativeStatistics(): WorkspaceCumulativeStatisticsList { return $this->proxy()->cumulativeStatistics; } /** * Access the taskChannels */ protected function getTaskChannels(): TaskChannelList { return $this->proxy()->taskChannels; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Taskrouter/V1/WorkspaceList.php 0000644 00000013752 15107452320 0012507 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class WorkspaceList extends ListResource { /** * Construct the WorkspaceList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Workspaces'; } /** * Streams WorkspaceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of WorkspaceInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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); } /** * Create the WorkspaceInstance * * @param string $friendlyName A string to describe the Workspace resource * @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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new WorkspaceInstance($this->version, $payload); } /** * Constructs a WorkspaceContext * * @param string $sid The SID of the resource to fetch */ 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]'; } } Taskrouter/V1/WorkspaceOptions.php 0000644 00000037661 15107452320 0013234 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1; use Twilio\Options; use Twilio\Values; abstract class WorkspaceOptions { /** * @param string $defaultActivitySid The SID of the Activity that will be used * when new Workers are created in the * Workspace * @param string $eventCallbackUrl The URL we should call when an event occurs * @param string $eventsFilter The list of Workspace events for which to call * event_callback_url * @param string $friendlyName A string to describe the Workspace resource * @param bool $multiTaskEnabled Whether multi-tasking is enabled * @param string $timeoutActivitySid The SID of the Activity that will be * assigned to a Worker when a Task * reservation times out without a response * @param string $prioritizeQueueOrder The type of TaskQueue to prioritize when * Workers are receiving Tasks from both * types of TaskQueues * @return UpdateWorkspaceOptions Options builder */ public static function update(string $defaultActivitySid = Values::NONE, string $eventCallbackUrl = Values::NONE, string $eventsFilter = Values::NONE, string $friendlyName = Values::NONE, bool $multiTaskEnabled = Values::NONE, string $timeoutActivitySid = Values::NONE, string $prioritizeQueueOrder = Values::NONE): UpdateWorkspaceOptions { return new UpdateWorkspaceOptions($defaultActivitySid, $eventCallbackUrl, $eventsFilter, $friendlyName, $multiTaskEnabled, $timeoutActivitySid, $prioritizeQueueOrder); } /** * @param string $friendlyName The friendly_name of the Workspace resources to * read * @return ReadWorkspaceOptions Options builder */ public static function read(string $friendlyName = Values::NONE): ReadWorkspaceOptions { return new ReadWorkspaceOptions($friendlyName); } /** * @param string $eventCallbackUrl The URL we should call when an event occurs * @param string $eventsFilter The list of Workspace events for which to call * event_callback_url * @param bool $multiTaskEnabled Whether multi-tasking is enabled * @param string $template An available template name * @param string $prioritizeQueueOrder The type of TaskQueue to prioritize when * Workers are receiving Tasks from both * types of TaskQueues * @return CreateWorkspaceOptions Options builder */ public static function create(string $eventCallbackUrl = Values::NONE, string $eventsFilter = Values::NONE, bool $multiTaskEnabled = Values::NONE, string $template = Values::NONE, string $prioritizeQueueOrder = Values::NONE): CreateWorkspaceOptions { return new CreateWorkspaceOptions($eventCallbackUrl, $eventsFilter, $multiTaskEnabled, $template, $prioritizeQueueOrder); } } class UpdateWorkspaceOptions extends Options { /** * @param string $defaultActivitySid The SID of the Activity that will be used * when new Workers are created in the * Workspace * @param string $eventCallbackUrl The URL we should call when an event occurs * @param string $eventsFilter The list of Workspace events for which to call * event_callback_url * @param string $friendlyName A string to describe the Workspace resource * @param bool $multiTaskEnabled Whether multi-tasking is enabled * @param string $timeoutActivitySid The SID of the Activity that will be * assigned to a Worker when a Task * reservation times out without a response * @param string $prioritizeQueueOrder The type of TaskQueue to prioritize when * Workers are receiving Tasks from both * types of TaskQueues */ public function __construct(string $defaultActivitySid = Values::NONE, string $eventCallbackUrl = Values::NONE, string $eventsFilter = Values::NONE, string $friendlyName = Values::NONE, bool $multiTaskEnabled = Values::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 * @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 * @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 string to describe the Workspace resource * @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 multi-tasking is enabled * @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; } /** * The type of TaskQueue to prioritize when Workers are receiving Tasks from both types of TaskQueues. Can be: `LIFO` or `FIFO`. For more information, see [Queue Ordering](https://www.twilio.com/docs/taskrouter/queue-ordering-last-first-out-lifo). * * @param string $prioritizeQueueOrder The type of TaskQueue to prioritize when * Workers are receiving Tasks from both * types of TaskQueues * @return $this Fluent Builder */ public function setPrioritizeQueueOrder(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 . ']'; } } class ReadWorkspaceOptions extends Options { /** * @param string $friendlyName The friendly_name of the Workspace resources to * read */ 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 * @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 CreateWorkspaceOptions extends Options { /** * @param string $eventCallbackUrl The URL we should call when an event occurs * @param string $eventsFilter The list of Workspace events for which to call * event_callback_url * @param bool $multiTaskEnabled Whether multi-tasking is enabled * @param string $template An available template name * @param string $prioritizeQueueOrder The type of TaskQueue to prioritize when * Workers are receiving Tasks from both * types of TaskQueues */ public function __construct(string $eventCallbackUrl = Values::NONE, string $eventsFilter = Values::NONE, bool $multiTaskEnabled = Values::NONE, string $template = Values::NONE, string $prioritizeQueueOrder = Values::NONE) { $this->options['eventCallbackUrl'] = $eventCallbackUrl; $this->options['eventsFilter'] = $eventsFilter; $this->options['multiTaskEnabled'] = $multiTaskEnabled; $this->options['template'] = $template; $this->options['prioritizeQueueOrder'] = $prioritizeQueueOrder; } /** * The URL we should call when an event occurs. If provided, the Workspace will publish events to this URL, for example, to collect data for reporting. See [Workspace Events](https://www.twilio.com/docs/taskrouter/api/event) for more information. 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 * @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 * @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 multi-tasking is enabled * @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 * @return $this Fluent Builder */ public function setTemplate(string $template): self { $this->options['template'] = $template; return $this; } /** * The type of TaskQueue to prioritize when Workers are receiving Tasks from both types of TaskQueues. Can be: `LIFO` or `FIFO` and the default is `FIFO`. For more information, see [Queue Ordering](https://www.twilio.com/docs/taskrouter/queue-ordering-last-first-out-lifo). * * @param string $prioritizeQueueOrder The type of TaskQueue to prioritize when * Workers are receiving Tasks from both * types of TaskQueues * @return $this Fluent Builder */ public function setPrioritizeQueueOrder(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 . ']'; } } Taskrouter/V1/Workspace/TaskQueueInstance.php 0000644 00000014004 15107452320 0015236 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueCumulativeStatisticsList; use Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueRealTimeStatisticsList; use Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueStatisticsList; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $assignmentActivitySid * @property string $assignmentActivityName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property int $maxReservedWorkers * @property string $reservationActivitySid * @property string $reservationActivityName * @property string $sid * @property string $targetWorkers * @property string $taskOrder * @property string $url * @property string $workspaceSid * @property array $links */ class TaskQueueInstance extends InstanceResource { protected $_statistics; protected $_realTimeStatistics; protected $_cumulativeStatistics; /** * Initialize the TaskQueueInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the * TaskQueue * @param string $sid The SID of the resource to */ public function __construct(Version $version, array $payload, string $workspaceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Access the statistics */ protected function getStatistics(): TaskQueueStatisticsList { return $this->proxy()->statistics; } /** * Access the realTimeStatistics */ protected function getRealTimeStatistics(): TaskQueueRealTimeStatisticsList { return $this->proxy()->realTimeStatistics; } /** * Access the cumulativeStatistics */ protected function getCumulativeStatistics(): TaskQueueCumulativeStatisticsList { 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.TaskQueueInstance ' . \implode(' ', $context) . ']'; } } Taskrouter/V1/Workspace/WorkerPage.php 0000644 00000002264 15107452320 0013715 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class WorkerPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsContext.php 0000644 00000004516 15107452320 0022532 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class TaskQueueRealTimeStatisticsContext extends InstanceContext { /** * Initialize the TaskQueueRealTimeStatisticsContext * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the TaskQueue to * fetch * @param string $taskQueueSid The SID of the TaskQueue for which to fetch * statistics */ public function __construct(Version $version, $workspaceSid, $taskQueueSid) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->fetch('GET', $this->uri, $params); return new TaskQueueRealTimeStatisticsInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['taskQueueSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.TaskQueueRealTimeStatisticsContext ' . \implode(' ', $context) . ']'; } } Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsInstance.php 0000644 00000013720 15107452320 0023263 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property int $avgTaskAcceptanceTime * @property \DateTime $startTime * @property \DateTime $endTime * @property int $reservationsCreated * @property int $reservationsAccepted * @property int $reservationsRejected * @property int $reservationsTimedOut * @property int $reservationsCanceled * @property int $reservationsRescinded * @property array $splitByWaitTime * @property string $taskQueueSid * @property array $waitDurationUntilAccepted * @property array $waitDurationUntilCanceled * @property array $waitDurationInQueueUntilAccepted * @property int $tasksCanceled * @property int $tasksCompleted * @property int $tasksDeleted * @property int $tasksEntered * @property int $tasksMoved * @property string $workspaceSid * @property string $url */ class TaskQueueCumulativeStatisticsInstance extends InstanceResource { /** * Initialize the TaskQueueCumulativeStatisticsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the * TaskQueue * @param string $taskQueueSid The SID of the TaskQueue from which these * statistics were calculated */ public function __construct(Version $version, array $payload, string $workspaceSid, string $taskQueueSid) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsOptions.php 0000644 00000013042 15107452320 0023147 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\Options; use Twilio\Values; abstract class TaskQueueCumulativeStatisticsOptions { /** * @param \DateTime $endDate Only calculate statistics from on or before this * date * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param string $taskChannel Only calculate cumulative statistics on this * TaskChannel * @param string $splitByWaitTime A comma separated list of values that * describes the thresholds, in seconds, to * calculate statistics on * @return FetchTaskQueueCumulativeStatisticsOptions Options builder */ public static function fetch(\DateTime $endDate = Values::NONE, int $minutes = Values::NONE, \DateTime $startDate = Values::NONE, string $taskChannel = Values::NONE, string $splitByWaitTime = Values::NONE): FetchTaskQueueCumulativeStatisticsOptions { return new FetchTaskQueueCumulativeStatisticsOptions($endDate, $minutes, $startDate, $taskChannel, $splitByWaitTime); } } class FetchTaskQueueCumulativeStatisticsOptions extends Options { /** * @param \DateTime $endDate Only calculate statistics from on or before this * date * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param string $taskChannel Only calculate cumulative statistics on this * TaskChannel * @param string $splitByWaitTime A comma separated list of values that * describes the thresholds, in seconds, to * calculate statistics on */ public function __construct(\DateTime $endDate = Values::NONE, int $minutes = Values::NONE, \DateTime $startDate = Values::NONE, string $taskChannel = Values::NONE, string $splitByWaitTime = Values::NONE) { $this->options['endDate'] = $endDate; $this->options['minutes'] = $minutes; $this->options['startDate'] = $startDate; $this->options['taskChannel'] = $taskChannel; $this->options['splitByWaitTime'] = $splitByWaitTime; } /** * Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * * @param \DateTime $endDate Only calculate statistics from on or before this * date * @return $this Fluent Builder */ public function setEndDate(\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 * @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 on or after this * date * @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 * @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 * @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 . ']'; } } Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsList.php 0000644 00000002703 15107452320 0020372 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\ListResource; use Twilio\Version; class TaskQueueStatisticsList extends ListResource { /** * Construct the TaskQueueStatisticsList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the * TaskQueue * @param string $taskQueueSid The SID of the TaskQueue from which these * statistics were calculated */ public function __construct(Version $version, string $workspaceSid, string $taskQueueSid) { parent::__construct($version); // Path Solution $this->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]'; } } Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsOptions.php 0000644 00000013746 15107452320 0021306 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\Options; use Twilio\Values; abstract class TaskQueuesStatisticsOptions { /** * @param \DateTime $endDate Only calculate statistics from on or before this * date * @param string $friendlyName The friendly_name of the TaskQueue statistics to * read * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param string $taskChannel Only calculate statistics on this TaskChannel. * @param string $splitByWaitTime A comma separated list of values that * describes the thresholds to calculate * statistics on * @return ReadTaskQueuesStatisticsOptions Options builder */ public static function read(\DateTime $endDate = Values::NONE, string $friendlyName = Values::NONE, int $minutes = Values::NONE, \DateTime $startDate = Values::NONE, string $taskChannel = Values::NONE, string $splitByWaitTime = Values::NONE): ReadTaskQueuesStatisticsOptions { return new ReadTaskQueuesStatisticsOptions($endDate, $friendlyName, $minutes, $startDate, $taskChannel, $splitByWaitTime); } } class ReadTaskQueuesStatisticsOptions extends Options { /** * @param \DateTime $endDate Only calculate statistics from on or before this * date * @param string $friendlyName The friendly_name of the TaskQueue statistics to * read * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param string $taskChannel Only calculate statistics on this TaskChannel. * @param string $splitByWaitTime A comma separated list of values that * describes the thresholds to calculate * statistics on */ public function __construct(\DateTime $endDate = Values::NONE, string $friendlyName = Values::NONE, int $minutes = Values::NONE, \DateTime $startDate = Values::NONE, string $taskChannel = Values::NONE, string $splitByWaitTime = Values::NONE) { $this->options['endDate'] = $endDate; $this->options['friendlyName'] = $friendlyName; $this->options['minutes'] = $minutes; $this->options['startDate'] = $startDate; $this->options['taskChannel'] = $taskChannel; $this->options['splitByWaitTime'] = $splitByWaitTime; } /** * Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * * @param \DateTime $endDate Only calculate statistics from on or before this * date * @return $this Fluent Builder */ public function setEndDate(\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 * @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 on or after this * date * @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. * @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 to calculate * statistics on * @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 . ']'; } } Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsContext.php 0000644 00000005221 15107452320 0023140 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class TaskQueueCumulativeStatisticsContext extends InstanceContext { /** * Initialize the TaskQueueCumulativeStatisticsContext * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the TaskQueue to * fetch * @param string $taskQueueSid The SID of the TaskQueue for which to fetch * statistics */ public function __construct(Version $version, $workspaceSid, $taskQueueSid) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->fetch('GET', $this->uri, $params); return new TaskQueueCumulativeStatisticsInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['taskQueueSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.TaskQueueCumulativeStatisticsContext ' . \implode(' ', $context) . ']'; } } Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsContext.php 0000644 00000005002 15107452320 0021076 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class TaskQueueStatisticsContext extends InstanceContext { /** * Initialize the TaskQueueStatisticsContext * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the TaskQueue to * fetch * @param string $taskQueueSid The SID of the TaskQueue for which to fetch * statistics */ public function __construct(Version $version, $workspaceSid, $taskQueueSid) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->fetch('GET', $this->uri, $params); return new TaskQueueStatisticsInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['taskQueueSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.TaskQueueStatisticsContext ' . \implode(' ', $context) . ']'; } } Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsPage.php 0000644 00000002434 15107452320 0020517 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class TaskQueuesStatisticsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsList.php 0000644 00000002763 15107452320 0022023 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\ListResource; use Twilio\Version; class TaskQueueRealTimeStatisticsList extends ListResource { /** * Construct the TaskQueueRealTimeStatisticsList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the * TaskQueue * @param string $taskQueueSid The SID of the TaskQueue from which these * statistics were calculated */ public function __construct(Version $version, string $workspaceSid, string $taskQueueSid) { parent::__construct($version); // Path Solution $this->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]'; } } Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsList.php 0000644 00000002777 15107452320 0022444 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\ListResource; use Twilio\Version; class TaskQueueCumulativeStatisticsList extends ListResource { /** * Construct the TaskQueueCumulativeStatisticsList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the * TaskQueue * @param string $taskQueueSid The SID of the TaskQueue from which these * statistics were calculated */ public function __construct(Version $version, string $workspaceSid, string $taskQueueSid) { parent::__construct($version); // Path Solution $this->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]'; } } Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsList.php 0000644 00000012722 15107452320 0020557 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class TaskQueuesStatisticsList extends ListResource { /** * Construct the TaskQueuesStatisticsList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the * TaskQueue */ public function __construct(Version $version, string $workspaceSid) { parent::__construct($version); // Path Solution $this->solution = ['workspaceSid' => $workspaceSid, ]; $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/TaskQueues/Statistics'; } /** * Streams TaskQueuesStatisticsInstance records from the API as a generator * stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of TaskQueuesStatisticsInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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]'; } } Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsInstance.php 0000644 00000007323 15107452320 0021226 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property array $cumulative * @property array $realtime * @property string $taskQueueSid * @property string $workspaceSid * @property string $url */ class TaskQueueStatisticsInstance extends InstanceResource { /** * Initialize the TaskQueueStatisticsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the * TaskQueue * @param string $taskQueueSid The SID of the TaskQueue from which these * statistics were calculated */ public function __construct(Version $version, array $payload, string $workspaceSid, string $taskQueueSid) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsOptions.php 0000644 00000012676 15107452320 0021124 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\Options; use Twilio\Values; abstract class TaskQueueStatisticsOptions { /** * @param \DateTime $endDate Only calculate statistics from on or before this * date * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param string $taskChannel Only calculate real-time and cumulative * statistics for the specified TaskChannel * @param string $splitByWaitTime A comma separated list of values that * describes the thresholds to calculate * statistics on * @return FetchTaskQueueStatisticsOptions Options builder */ public static function fetch(\DateTime $endDate = Values::NONE, int $minutes = Values::NONE, \DateTime $startDate = Values::NONE, string $taskChannel = Values::NONE, string $splitByWaitTime = Values::NONE): FetchTaskQueueStatisticsOptions { return new FetchTaskQueueStatisticsOptions($endDate, $minutes, $startDate, $taskChannel, $splitByWaitTime); } } class FetchTaskQueueStatisticsOptions extends Options { /** * @param \DateTime $endDate Only calculate statistics from on or before this * date * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param string $taskChannel Only calculate real-time and cumulative * statistics for the specified TaskChannel * @param string $splitByWaitTime A comma separated list of values that * describes the thresholds to calculate * statistics on */ public function __construct(\DateTime $endDate = Values::NONE, int $minutes = Values::NONE, \DateTime $startDate = Values::NONE, string $taskChannel = Values::NONE, string $splitByWaitTime = Values::NONE) { $this->options['endDate'] = $endDate; $this->options['minutes'] = $minutes; $this->options['startDate'] = $startDate; $this->options['taskChannel'] = $taskChannel; $this->options['splitByWaitTime'] = $splitByWaitTime; } /** * Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * * @param \DateTime $endDate Only calculate statistics from on or before this * date * @return $this Fluent Builder */ public function setEndDate(\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 * @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 on or after this * date * @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 * @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 to calculate * statistics on * @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 . ']'; } } Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsInstance.php 0000644 00000011723 15107452320 0022650 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property array[] $activityStatistics * @property int $longestTaskWaitingAge * @property string $longestTaskWaitingSid * @property int $longestRelativeTaskAgeInQueue * @property string $longestRelativeTaskSidInQueue * @property string $taskQueueSid * @property array $tasksByPriority * @property array $tasksByStatus * @property int $totalAvailableWorkers * @property int $totalEligibleWorkers * @property int $totalTasks * @property string $workspaceSid * @property string $url */ class TaskQueueRealTimeStatisticsInstance extends InstanceResource { /** * Initialize the TaskQueueRealTimeStatisticsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the * TaskQueue * @param string $taskQueueSid The SID of the TaskQueue from which these * statistics were calculated */ public function __construct(Version $version, array $payload, string $workspaceSid, string $taskQueueSid) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsPage.php 0000644 00000002641 15107452320 0021757 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class TaskQueueRealTimeStatisticsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsPage.php 0000644 00000002561 15107452320 0020335 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class TaskQueueStatisticsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsOptions.php 0000644 00000003232 15107452321 0022534 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\Options; use Twilio\Values; abstract class TaskQueueRealTimeStatisticsOptions { /** * @param string $taskChannel The TaskChannel for which to fetch statistics * @return FetchTaskQueueRealTimeStatisticsOptions Options builder */ public static function fetch(string $taskChannel = Values::NONE): FetchTaskQueueRealTimeStatisticsOptions { return new FetchTaskQueueRealTimeStatisticsOptions($taskChannel); } } class FetchTaskQueueRealTimeStatisticsOptions extends Options { /** * @param string $taskChannel The TaskChannel for which to fetch statistics */ public function __construct(string $taskChannel = Values::NONE) { $this->options['taskChannel'] = $taskChannel; } /** * The TaskChannel for which to fetch statistics. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * * @param string $taskChannel The TaskChannel for which to fetch statistics * @return $this Fluent Builder */ public function setTaskChannel(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 . ']'; } } Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsInstance.php 0000644 00000004357 15107452321 0021416 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property array $cumulative * @property array $realtime * @property string $taskQueueSid * @property string $workspaceSid */ class TaskQueuesStatisticsInstance extends InstanceResource { /** * Initialize the TaskQueuesStatisticsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the * TaskQueue */ public function __construct(Version $version, array $payload, string $workspaceSid) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsPage.php 0000644 00000002655 15107452321 0022401 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class TaskQueueCumulativeStatisticsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Taskrouter/V1/Workspace/Worker/WorkerChannelPage.php 0000644 00000002504 15107452321 0016455 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class WorkerChannelPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Taskrouter/V1/Workspace/Worker/WorkersStatisticsInstance.php 0000644 00000006332 15107452321 0020315 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property array $realtime * @property array $cumulative * @property string $accountSid * @property string $workspaceSid * @property string $url */ class WorkersStatisticsInstance extends InstanceResource { /** * Initialize the WorkersStatisticsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the Worker */ public function __construct(Version $version, array $payload, string $workspaceSid) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsPage.php 0000644 00000002556 15107452321 0021470 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class WorkersCumulativeStatisticsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Taskrouter/V1/Workspace/Worker/WorkerStatisticsContext.php 0000644 00000004624 15107452321 0020014 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class WorkerStatisticsContext extends InstanceContext { /** * Initialize the WorkerStatisticsContext * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the WorkerChannel * to fetch * @param string $workerSid The SID of the Worker with the WorkerChannel to * fetch */ public function __construct(Version $version, $workspaceSid, $workerSid) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->fetch('GET', $this->uri, $params); return new WorkerStatisticsInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['workerSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkerStatisticsContext ' . \implode(' ', $context) . ']'; } } Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsInstance.php 0000644 00000007013 15107452321 0021735 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property array[] $activityStatistics * @property int $totalWorkers * @property string $workspaceSid * @property string $url */ class WorkersRealTimeStatisticsInstance extends InstanceResource { /** * Initialize the WorkersRealTimeStatisticsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the * Workers */ public function __construct(Version $version, array $payload, string $workspaceSid) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Taskrouter/V1/Workspace/Worker/WorkersStatisticsContext.php 0000644 00000004405 15107452321 0020174 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class WorkersStatisticsContext extends InstanceContext { /** * Initialize the WorkersStatisticsContext * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the Worker to fetch */ public function __construct(Version $version, $workspaceSid) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->fetch('GET', $this->uri, $params); return new WorkersStatisticsInstance($this->version, $payload, $this->solution['workspaceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkersStatisticsContext ' . \implode(' ', $context) . ']'; } } Taskrouter/V1/Workspace/Worker/WorkerStatisticsList.php 0000644 00000002621 15107452321 0017276 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\ListResource; use Twilio\Version; class WorkerStatisticsList extends ListResource { /** * Construct the WorkerStatisticsList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the * WorkerChannel * @param string $workerSid The SID of the Worker that contains the * WorkerChannel */ public function __construct(Version $version, string $workspaceSid, string $workerSid) { parent::__construct($version); // Path Solution $this->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]'; } } Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsPage.php 0000644 00000002542 15107452321 0021047 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class WorkersRealTimeStatisticsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Taskrouter/V1/Workspace/Worker/WorkerStatisticsInstance.php 0000644 00000006776 15107452321 0020146 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property array $cumulative * @property string $workerSid * @property string $workspaceSid * @property string $url */ class WorkerStatisticsInstance extends InstanceResource { /** * Initialize the WorkerStatisticsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the * WorkerChannel * @param string $workerSid The SID of the Worker that contains the * WorkerChannel */ public function __construct(Version $version, array $payload, string $workspaceSid, string $workerSid) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Taskrouter/V1/Workspace/Worker/ReservationInstance.php 0000644 00000011103 15107452321 0017077 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $reservationStatus * @property string $sid * @property string $taskSid * @property string $workerName * @property string $workerSid * @property string $workspaceSid * @property string $url * @property array $links */ class ReservationInstance extends InstanceResource { /** * Initialize the ReservationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that this worker is * contained within. * @param string $workerSid The SID of the reserved Worker resource * @param string $sid The SID of the WorkerReservation resource to fetch */ public function __construct(Version $version, array $payload, string $workspaceSid, string $workerSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsContext.php 0000644 00000004473 15107452321 0022240 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class WorkersCumulativeStatisticsContext extends InstanceContext { /** * Initialize the WorkersCumulativeStatisticsContext * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the resource to * fetch */ public function __construct(Version $version, $workspaceSid) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->fetch('GET', $this->uri, $params); return new WorkersCumulativeStatisticsInstance( $this->version, $payload, $this->solution['workspaceSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkersCumulativeStatisticsContext ' . \implode(' ', $context) . ']'; } } Taskrouter/V1/Workspace/Worker/ReservationOptions.php 0000644 00000144115 15107452321 0017000 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Options; use Twilio\Values; abstract class ReservationOptions { /** * @param string $reservationStatus Returns the list of reservations for a * worker with a specified ReservationStatus * @return ReadReservationOptions Options builder */ public static function read(string $reservationStatus = Values::NONE): ReadReservationOptions { return new ReadReservationOptions($reservationStatus); } /** * @param string $reservationStatus The new status of the reservation * @param string $workerActivitySid The new worker activity SID if rejecting a * reservation * @param string $instruction The assignment instruction for the reservation * @param string $dequeuePostWorkActivitySid The SID of the Activity resource * to start after executing a Dequeue * instruction * @param string $dequeueFrom The caller ID of the call to the worker when * executing a Dequeue instruction * @param string $dequeueRecord Whether to record both legs of a call when * executing a Dequeue instruction * @param int $dequeueTimeout The timeout for call when executing a Dequeue * instruction * @param string $dequeueTo The contact URI of the worker when executing a * Dequeue instruction * @param string $dequeueStatusCallbackUrl The callback URL for completed call * event when executing a Dequeue * instruction * @param string $callFrom The Caller ID of the outbound call when executing a * Call instruction * @param string $callRecord Whether to record both legs of a call when * executing a Call instruction * @param int $callTimeout The timeout for a call when executing a Call * instruction * @param string $callTo The contact URI of the worker when executing a Call * instruction * @param string $callUrl TwiML URI executed on answering the worker's leg as a * result of the Call instruction * @param string $callStatusCallbackUrl The URL to call for the completed call * event when executing a Call instruction * @param bool $callAccept Whether to accept a reservation when executing a * Call instruction * @param string $redirectCallSid The Call SID of the call parked in the queue * when executing a Redirect instruction * @param bool $redirectAccept Whether the reservation should be accepted when * executing a Redirect instruction * @param string $redirectUrl TwiML URI to redirect the call to when executing * the Redirect instruction * @param string $to The Contact URI of the worker when executing a Conference * instruction * @param string $from The caller ID of the call to the worker when executing a * Conference instruction * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @param string[] $statusCallbackEvent The call progress events that we will * send to status_callback * @param int $timeout The timeout for a call when executing a Conference * instruction * @param bool $record Whether to record the participant and their conferences * @param bool $muted Whether to mute the agent * @param string $beep Whether to play a notification beep when the participant * joins * @param bool $startConferenceOnEnter Whether the conference starts when the * participant joins the conference * @param bool $endConferenceOnExit Whether to end the conference when the * agent leaves * @param string $waitUrl URL that hosts pre-conference hold music * @param string $waitMethod The HTTP method we should use to call `wait_url` * @param bool $earlyMedia Whether agents can hear the state of the outbound * call * @param int $maxParticipants The maximum number of agent conference * participants * @param string $conferenceStatusCallback The callback URL for conference * events * @param string $conferenceStatusCallbackMethod HTTP method for requesting * `conference_status_callback` * URL * @param string[] $conferenceStatusCallbackEvent The conference status events * that we will send to * conference_status_callback * @param string $conferenceRecord Whether to record the conference the * participant is joining * @param string $conferenceTrim Whether to trim leading and trailing silence * from your recorded conference audio files * @param string $recordingChannels Specify `mono` or `dual` recording channels * @param string $recordingStatusCallback The URL that we should call using the * `recording_status_callback_method` * when the recording status changes * @param string $recordingStatusCallbackMethod The HTTP method we should use * when we call * `recording_status_callback` * @param string $conferenceRecordingStatusCallback The URL we should call * using the * `conference_recording_status_callback_method` when the conference recording is available * @param string $conferenceRecordingStatusCallbackMethod The HTTP method we * should use to call * `conference_recording_status_callback` * @param string $region The region where we should mix the conference audio * @param string $sipAuthUsername The SIP username used for authentication * @param string $sipAuthPassword The SIP password for authentication * @param string[] $dequeueStatusCallbackEvent The call progress events sent * via webhooks as a result of a * Dequeue instruction * @param string $postWorkActivitySid The new worker activity SID after * executing a Conference instruction * @param bool $endConferenceOnCustomerExit Whether to end the conference when * the customer leaves * @param bool $beepOnCustomerEntrance Whether to play a notification beep when * the customer joins * @param string $ifMatch The If-Match HTTP request header * @return UpdateReservationOptions Options builder */ public static function update(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::NONE, string $dequeueTo = Values::NONE, string $dequeueStatusCallbackUrl = Values::NONE, string $callFrom = Values::NONE, string $callRecord = Values::NONE, int $callTimeout = Values::NONE, string $callTo = Values::NONE, string $callUrl = Values::NONE, string $callStatusCallbackUrl = Values::NONE, bool $callAccept = Values::NONE, string $redirectCallSid = Values::NONE, bool $redirectAccept = Values::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::NONE, bool $record = Values::NONE, bool $muted = Values::NONE, string $beep = Values::NONE, bool $startConferenceOnEnter = Values::NONE, bool $endConferenceOnExit = Values::NONE, string $waitUrl = Values::NONE, string $waitMethod = Values::NONE, bool $earlyMedia = Values::NONE, int $maxParticipants = Values::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::NONE, bool $beepOnCustomerEntrance = Values::NONE, string $ifMatch = Values::NONE): UpdateReservationOptions { return new UpdateReservationOptions($reservationStatus, $workerActivitySid, $instruction, $dequeuePostWorkActivitySid, $dequeueFrom, $dequeueRecord, $dequeueTimeout, $dequeueTo, $dequeueStatusCallbackUrl, $callFrom, $callRecord, $callTimeout, $callTo, $callUrl, $callStatusCallbackUrl, $callAccept, $redirectCallSid, $redirectAccept, $redirectUrl, $to, $from, $statusCallback, $statusCallbackMethod, $statusCallbackEvent, $timeout, $record, $muted, $beep, $startConferenceOnEnter, $endConferenceOnExit, $waitUrl, $waitMethod, $earlyMedia, $maxParticipants, $conferenceStatusCallback, $conferenceStatusCallbackMethod, $conferenceStatusCallbackEvent, $conferenceRecord, $conferenceTrim, $recordingChannels, $recordingStatusCallback, $recordingStatusCallbackMethod, $conferenceRecordingStatusCallback, $conferenceRecordingStatusCallbackMethod, $region, $sipAuthUsername, $sipAuthPassword, $dequeueStatusCallbackEvent, $postWorkActivitySid, $endConferenceOnCustomerExit, $beepOnCustomerEntrance, $ifMatch); } } class ReadReservationOptions extends Options { /** * @param string $reservationStatus Returns the list of reservations for a * worker with a specified ReservationStatus */ public function __construct(string $reservationStatus = Values::NONE) { $this->options['reservationStatus'] = $reservationStatus; } /** * Returns the list of reservations for a worker with a specified ReservationStatus. Can be: `pending`, `accepted`, `rejected`, `timeout`, `canceled`, or `rescinded`. * * @param string $reservationStatus Returns the list of reservations for a * worker with a specified ReservationStatus * @return $this Fluent Builder */ public function setReservationStatus(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 The new status of the reservation * @param string $workerActivitySid The new worker activity SID if rejecting a * reservation * @param string $instruction The assignment instruction for the reservation * @param string $dequeuePostWorkActivitySid The SID of the Activity resource * to start after executing a Dequeue * instruction * @param string $dequeueFrom The caller ID of the call to the worker when * executing a Dequeue instruction * @param string $dequeueRecord Whether to record both legs of a call when * executing a Dequeue instruction * @param int $dequeueTimeout The timeout for call when executing a Dequeue * instruction * @param string $dequeueTo The contact URI of the worker when executing a * Dequeue instruction * @param string $dequeueStatusCallbackUrl The callback URL for completed call * event when executing a Dequeue * instruction * @param string $callFrom The Caller ID of the outbound call when executing a * Call instruction * @param string $callRecord Whether to record both legs of a call when * executing a Call instruction * @param int $callTimeout The timeout for a call when executing a Call * instruction * @param string $callTo The contact URI of the worker when executing a Call * instruction * @param string $callUrl TwiML URI executed on answering the worker's leg as a * result of the Call instruction * @param string $callStatusCallbackUrl The URL to call for the completed call * event when executing a Call instruction * @param bool $callAccept Whether to accept a reservation when executing a * Call instruction * @param string $redirectCallSid The Call SID of the call parked in the queue * when executing a Redirect instruction * @param bool $redirectAccept Whether the reservation should be accepted when * executing a Redirect instruction * @param string $redirectUrl TwiML URI to redirect the call to when executing * the Redirect instruction * @param string $to The Contact URI of the worker when executing a Conference * instruction * @param string $from The caller ID of the call to the worker when executing a * Conference instruction * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @param string[] $statusCallbackEvent The call progress events that we will * send to status_callback * @param int $timeout The timeout for a call when executing a Conference * instruction * @param bool $record Whether to record the participant and their conferences * @param bool $muted Whether to mute the agent * @param string $beep Whether to play a notification beep when the participant * joins * @param bool $startConferenceOnEnter Whether the conference starts when the * participant joins the conference * @param bool $endConferenceOnExit Whether to end the conference when the * agent leaves * @param string $waitUrl URL that hosts pre-conference hold music * @param string $waitMethod The HTTP method we should use to call `wait_url` * @param bool $earlyMedia Whether agents can hear the state of the outbound * call * @param int $maxParticipants The maximum number of agent conference * participants * @param string $conferenceStatusCallback The callback URL for conference * events * @param string $conferenceStatusCallbackMethod HTTP method for requesting * `conference_status_callback` * URL * @param string[] $conferenceStatusCallbackEvent The conference status events * that we will send to * conference_status_callback * @param string $conferenceRecord Whether to record the conference the * participant is joining * @param string $conferenceTrim Whether to trim leading and trailing silence * from your recorded conference audio files * @param string $recordingChannels Specify `mono` or `dual` recording channels * @param string $recordingStatusCallback The URL that we should call using the * `recording_status_callback_method` * when the recording status changes * @param string $recordingStatusCallbackMethod The HTTP method we should use * when we call * `recording_status_callback` * @param string $conferenceRecordingStatusCallback The URL we should call * using the * `conference_recording_status_callback_method` when the conference recording is available * @param string $conferenceRecordingStatusCallbackMethod The HTTP method we * should use to call * `conference_recording_status_callback` * @param string $region The region where we should mix the conference audio * @param string $sipAuthUsername The SIP username used for authentication * @param string $sipAuthPassword The SIP password for authentication * @param string[] $dequeueStatusCallbackEvent The call progress events sent * via webhooks as a result of a * Dequeue instruction * @param string $postWorkActivitySid The new worker activity SID after * executing a Conference instruction * @param bool $endConferenceOnCustomerExit Whether to end the conference when * the customer leaves * @param bool $beepOnCustomerEntrance Whether to play a notification beep when * the customer joins * @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::NONE, string $dequeueTo = Values::NONE, string $dequeueStatusCallbackUrl = Values::NONE, string $callFrom = Values::NONE, string $callRecord = Values::NONE, int $callTimeout = Values::NONE, string $callTo = Values::NONE, string $callUrl = Values::NONE, string $callStatusCallbackUrl = Values::NONE, bool $callAccept = Values::NONE, string $redirectCallSid = Values::NONE, bool $redirectAccept = Values::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::NONE, bool $record = Values::NONE, bool $muted = Values::NONE, string $beep = Values::NONE, bool $startConferenceOnEnter = Values::NONE, bool $endConferenceOnExit = Values::NONE, string $waitUrl = Values::NONE, string $waitMethod = Values::NONE, bool $earlyMedia = Values::NONE, int $maxParticipants = Values::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::NONE, bool $beepOnCustomerEntrance = 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['ifMatch'] = $ifMatch; } /** * The new status of the reservation. Can be: `pending`, `accepted`, `rejected`, `timeout`, `canceled`, or `rescinded`. * * @param string $reservationStatus The new status of the reservation * @return $this Fluent Builder */ public function setReservationStatus(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 * @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 * @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 * @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 * @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 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 * @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 * @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 * @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 to mute the agent * @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 * @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 the conference starts when the * participant joins 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 URL that hosts pre-conference hold music * @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` * @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 agents can hear the state of the outbound * call * @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 agent conference * participants * @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 callback URL for conference * events * @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 HTTP method for requesting * `conference_status_callback` * URL * @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 * @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 * @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 * @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 Specify `mono` or `dual` recording channels * @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` * @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` * @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 where we should mix the conference audio * @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 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 . ']'; } } Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsList.php 0000644 00000002321 15107452321 0021101 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\ListResource; use Twilio\Version; class WorkersRealTimeStatisticsList extends ListResource { /** * Construct the WorkersRealTimeStatisticsList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the * Workers */ public function __construct(Version $version, string $workspaceSid) { parent::__construct($version); // Path Solution $this->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]'; } } Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsOptions.php 0000644 00000003431 15107452321 0021624 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Options; use Twilio\Values; abstract class WorkersRealTimeStatisticsOptions { /** * @param string $taskChannel Only calculate real-time statistics on this * TaskChannel * @return FetchWorkersRealTimeStatisticsOptions Options builder */ public static function fetch(string $taskChannel = Values::NONE): FetchWorkersRealTimeStatisticsOptions { return new FetchWorkersRealTimeStatisticsOptions($taskChannel); } } class FetchWorkersRealTimeStatisticsOptions extends Options { /** * @param string $taskChannel Only calculate real-time statistics on this * TaskChannel */ public function __construct(string $taskChannel = Values::NONE) { $this->options['taskChannel'] = $taskChannel; } /** * Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * * @param string $taskChannel Only calculate real-time statistics on this * TaskChannel * @return $this Fluent Builder */ public function setTaskChannel(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 . ']'; } } Taskrouter/V1/Workspace/Worker/WorkersStatisticsPage.php 0000644 00000002404 15107452321 0017421 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class WorkersStatisticsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsContext.php 0000644 00000004066 15107452321 0021622 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class WorkersRealTimeStatisticsContext extends InstanceContext { /** * Initialize the WorkersRealTimeStatisticsContext * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the resource to * fetch */ public function __construct(Version $version, $workspaceSid) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->fetch('GET', $this->uri, $params); return new WorkersRealTimeStatisticsInstance( $this->version, $payload, $this->solution['workspaceSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkersRealTimeStatisticsContext ' . \implode(' ', $context) . ']'; } } Taskrouter/V1/Workspace/Worker/WorkersStatisticsOptions.php 0000644 00000015171 15107452321 0020205 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Options; use Twilio\Values; abstract class WorkersStatisticsOptions { /** * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param \DateTime $endDate Only calculate statistics from this date and time * and earlier * @param string $taskQueueSid The SID of the TaskQueue for which to fetch * Worker statistics * @param string $taskQueueName The friendly_name of the TaskQueue for which to * fetch Worker statistics * @param string $friendlyName Only include Workers with `friendly_name` values * that match this parameter * @param string $taskChannel Only calculate statistics on this TaskChannel * @return FetchWorkersStatisticsOptions Options builder */ public static function fetch(int $minutes = Values::NONE, \DateTime $startDate = Values::NONE, \DateTime $endDate = Values::NONE, string $taskQueueSid = Values::NONE, string $taskQueueName = Values::NONE, string $friendlyName = Values::NONE, string $taskChannel = Values::NONE): FetchWorkersStatisticsOptions { return new FetchWorkersStatisticsOptions($minutes, $startDate, $endDate, $taskQueueSid, $taskQueueName, $friendlyName, $taskChannel); } } class FetchWorkersStatisticsOptions extends Options { /** * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param \DateTime $endDate Only calculate statistics from this date and time * and earlier * @param string $taskQueueSid The SID of the TaskQueue for which to fetch * Worker statistics * @param string $taskQueueName The friendly_name of the TaskQueue for which to * fetch Worker statistics * @param string $friendlyName Only include Workers with `friendly_name` values * that match this parameter * @param string $taskChannel Only calculate statistics on this TaskChannel */ public function __construct(int $minutes = Values::NONE, \DateTime $startDate = Values::NONE, \DateTime $endDate = Values::NONE, string $taskQueueSid = Values::NONE, string $taskQueueName = Values::NONE, string $friendlyName = Values::NONE, string $taskChannel = Values::NONE) { $this->options['minutes'] = $minutes; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['taskQueueSid'] = $taskQueueSid; $this->options['taskQueueName'] = $taskQueueName; $this->options['friendlyName'] = $friendlyName; $this->options['taskChannel'] = $taskChannel; } /** * Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. * * @param int $minutes Only calculate statistics since this many minutes in the * past * @return $this Fluent Builder */ public function setMinutes(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 on or after this * date * @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 * @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 * @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 . ']'; } } Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsInstance.php 0000644 00000010732 15107452321 0022353 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property \DateTime $startTime * @property \DateTime $endTime * @property array[] $activityDurations * @property int $reservationsCreated * @property int $reservationsAccepted * @property int $reservationsRejected * @property int $reservationsTimedOut * @property int $reservationsCanceled * @property int $reservationsRescinded * @property string $workspaceSid * @property string $url */ class WorkersCumulativeStatisticsInstance extends InstanceResource { /** * Initialize the WorkersCumulativeStatisticsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the * Workers */ public function __construct(Version $version, array $payload, string $workspaceSid) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsOptions.php 0000644 00000010426 15107452321 0022242 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Options; use Twilio\Values; abstract class WorkersCumulativeStatisticsOptions { /** * @param \DateTime $endDate Only calculate statistics from on or before this * date * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param string $taskChannel Only calculate cumulative statistics on this * TaskChannel * @return FetchWorkersCumulativeStatisticsOptions Options builder */ public static function fetch(\DateTime $endDate = Values::NONE, int $minutes = Values::NONE, \DateTime $startDate = Values::NONE, string $taskChannel = Values::NONE): FetchWorkersCumulativeStatisticsOptions { return new FetchWorkersCumulativeStatisticsOptions($endDate, $minutes, $startDate, $taskChannel); } } class FetchWorkersCumulativeStatisticsOptions extends Options { /** * @param \DateTime $endDate Only calculate statistics from on or before this * date * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param string $taskChannel Only calculate cumulative statistics on this * TaskChannel */ public function __construct(\DateTime $endDate = Values::NONE, int $minutes = Values::NONE, \DateTime $startDate = Values::NONE, string $taskChannel = Values::NONE) { $this->options['endDate'] = $endDate; $this->options['minutes'] = $minutes; $this->options['startDate'] = $startDate; $this->options['taskChannel'] = $taskChannel; } /** * Only calculate statistics from this date and time and earlier, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * * @param \DateTime $endDate Only calculate statistics from on or before this * date * @return $this Fluent Builder */ public function setEndDate(\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 * @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 on or after this * date * @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 * @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 . ']'; } } Taskrouter/V1/Workspace/Worker/WorkersStatisticsList.php 0000644 00000002175 15107452321 0017465 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\ListResource; use Twilio\Version; class WorkersStatisticsList extends ListResource { /** * Construct the WorkersStatisticsList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the Worker */ public function __construct(Version $version, string $workspaceSid) { parent::__construct($version); // Path Solution $this->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]'; } } Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsList.php 0000644 00000002335 15107452321 0021522 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\ListResource; use Twilio\Version; class WorkersCumulativeStatisticsList extends ListResource { /** * Construct the WorkersCumulativeStatisticsList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the * Workers */ public function __construct(Version $version, string $workspaceSid) { parent::__construct($version); // Path Solution $this->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]'; } } Taskrouter/V1/Workspace/Worker/WorkerChannelOptions.php 0000644 00000004722 15107452321 0017240 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Options; use Twilio\Values; abstract class WorkerChannelOptions { /** * @param int $capacity The total number of Tasks that the Worker should handle * for the TaskChannel type * @param bool $available Whether the WorkerChannel is available * @return UpdateWorkerChannelOptions Options builder */ public static function update(int $capacity = Values::NONE, bool $available = Values::NONE): UpdateWorkerChannelOptions { return new UpdateWorkerChannelOptions($capacity, $available); } } class UpdateWorkerChannelOptions extends Options { /** * @param int $capacity The total number of Tasks that the Worker should handle * for the TaskChannel type * @param bool $available Whether the WorkerChannel is available */ public function __construct(int $capacity = Values::NONE, bool $available = Values::NONE) { $this->options['capacity'] = $capacity; $this->options['available'] = $available; } /** * The total number of Tasks that the Worker should handle for the TaskChannel type. TaskRouter creates reservations for Tasks of this TaskChannel type up to the specified capacity. If the capacity is 0, no new reservations will be created. * * @param int $capacity The total number of Tasks that the Worker should handle * for the TaskChannel type * @return $this Fluent Builder */ public function setCapacity(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 * @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 . ']'; } } Taskrouter/V1/Workspace/Worker/WorkerChannelContext.php 0000644 00000005635 15107452321 0017235 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class WorkerChannelContext extends InstanceContext { /** * Initialize the WorkerChannelContext * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the WorkerChannel * to fetch * @param string $workerSid The SID of the Worker with the WorkerChannel to * fetch * @param string $sid The SID of the to fetch */ public function __construct(Version $version, $workspaceSid, $workerSid, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new WorkerChannelInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['workerSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkerChannelContext ' . \implode(' ', $context) . ']'; } } Taskrouter/V1/Workspace/Worker/WorkerStatisticsOptions.php 0000644 00000010117 15107452321 0020015 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Options; use Twilio\Values; abstract class WorkerStatisticsOptions { /** * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param string $taskChannel Only calculate statistics on this TaskChannel * @return FetchWorkerStatisticsOptions Options builder */ public static function fetch(int $minutes = Values::NONE, \DateTime $startDate = Values::NONE, \DateTime $endDate = Values::NONE, string $taskChannel = Values::NONE): FetchWorkerStatisticsOptions { return new FetchWorkerStatisticsOptions($minutes, $startDate, $endDate, $taskChannel); } } class FetchWorkerStatisticsOptions extends Options { /** * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param string $taskChannel Only calculate statistics on this TaskChannel */ public function __construct(int $minutes = Values::NONE, \DateTime $startDate = Values::NONE, \DateTime $endDate = Values::NONE, string $taskChannel = Values::NONE) { $this->options['minutes'] = $minutes; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['taskChannel'] = $taskChannel; } /** * Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. * * @param int $minutes Only calculate statistics since this many minutes in the * past * @return $this Fluent Builder */ public function setMinutes(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 on or after this * 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, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * * @param \DateTime $endDate Only include usage that occurred on or before this * date * @return $this Fluent Builder */ public function setEndDate(\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 * @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 . ']'; } } Taskrouter/V1/Workspace/Worker/WorkerStatisticsPage.php 0000644 00000002526 15107452321 0017243 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class WorkerStatisticsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Taskrouter/V1/Workspace/Worker/WorkerChannelList.php 0000644 00000012235 15107452321 0016516 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class WorkerChannelList extends ListResource { /** * Construct the WorkerChannelList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the * WorkerChannel * @param string $workerSid The SID of the Worker that contains the * WorkerChannel */ public function __construct(Version $version, string $workspaceSid, string $workerSid) { parent::__construct($version); // Path Solution $this->solution = ['workspaceSid' => $workspaceSid, 'workerSid' => $workerSid, ]; $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/Workers/' . \rawurlencode($workerSid) . '/Channels'; } /** * Streams WorkerChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 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]'; } } Taskrouter/V1/Workspace/Worker/ReservationList.php 0000644 00000013026 15107452321 0016254 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ReservationList extends ListResource { /** * Construct the ReservationList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that this worker is * contained within. * @param string $workerSid The SID of the reserved Worker resource */ public function __construct(Version $version, string $workspaceSid, string $workerSid) { parent::__construct($version); // Path Solution $this->solution = ['workspaceSid' => $workspaceSid, 'workerSid' => $workerSid, ]; $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/Workers/' . \rawurlencode($workerSid) . '/Reservations'; } /** * Streams ReservationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of ReservationInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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]'; } } Taskrouter/V1/Workspace/Worker/WorkerChannelInstance.php 0000644 00000011671 15107452321 0017352 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property int $assignedTasks * @property bool $available * @property int $availableCapacityPercentage * @property int $configuredCapacity * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $sid * @property string $taskChannelSid * @property string $taskChannelUniqueName * @property string $workerSid * @property string $workspaceSid * @property string $url */ class WorkerChannelInstance extends InstanceResource { /** * Initialize the WorkerChannelInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the * WorkerChannel * @param string $workerSid The SID of the Worker that contains the * WorkerChannel * @param string $sid The SID of the to fetch */ public function __construct(Version $version, array $payload, string $workspaceSid, string $workerSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Taskrouter/V1/Workspace/Worker/ReservationPage.php 0000644 00000002470 15107452322 0016217 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ReservationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Taskrouter/V1/Workspace/Worker/ReservationContext.php 0000644 00000014711 15107452322 0016770 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class ReservationContext extends InstanceContext { /** * Initialize the ReservationContext * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the * WorkerReservation resource to fetch * @param string $workerSid The SID of the reserved Worker resource with the * WorkerReservation resource to fetch * @param string $sid The SID of the WorkerReservation resource to fetch */ public function __construct(Version $version, $workspaceSid, $workerSid, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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' => Serialize::map($options['statusCallbackEvent'], function($e) { return $e; }), 'Timeout' => $options['timeout'], 'Record' => Serialize::booleanToString($options['record']), 'Muted' => Serialize::booleanToString($options['muted']), 'Beep' => $options['beep'], 'StartConferenceOnEnter' => Serialize::booleanToString($options['startConferenceOnEnter']), 'EndConferenceOnExit' => Serialize::booleanToString($options['endConferenceOnExit']), 'WaitUrl' => $options['waitUrl'], 'WaitMethod' => $options['waitMethod'], 'EarlyMedia' => Serialize::booleanToString($options['earlyMedia']), 'MaxParticipants' => $options['maxParticipants'], 'ConferenceStatusCallback' => $options['conferenceStatusCallback'], 'ConferenceStatusCallbackMethod' => $options['conferenceStatusCallbackMethod'], 'ConferenceStatusCallbackEvent' => Serialize::map($options['conferenceStatusCallbackEvent'], function($e) { return $e; }), 'ConferenceRecord' => $options['conferenceRecord'], 'ConferenceTrim' => $options['conferenceTrim'], 'RecordingChannels' => $options['recordingChannels'], 'RecordingStatusCallback' => $options['recordingStatusCallback'], 'RecordingStatusCallbackMethod' => $options['recordingStatusCallbackMethod'], 'ConferenceRecordingStatusCallback' => $options['conferenceRecordingStatusCallback'], 'ConferenceRecordingStatusCallbackMethod' => $options['conferenceRecordingStatusCallbackMethod'], 'Region' => $options['region'], 'SipAuthUsername' => $options['sipAuthUsername'], 'SipAuthPassword' => $options['sipAuthPassword'], 'DequeueStatusCallbackEvent' => Serialize::map($options['dequeueStatusCallbackEvent'], function($e) { return $e; }), 'PostWorkActivitySid' => $options['postWorkActivitySid'], 'EndConferenceOnCustomerExit' => Serialize::booleanToString($options['endConferenceOnCustomerExit']), 'BeepOnCustomerEntrance' => Serialize::booleanToString($options['beepOnCustomerEntrance']), ]); $headers = Values::of(['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) . ']'; } } Taskrouter/V1/Workspace/WorkspaceStatisticsPage.php 0000644 00000002402 15107452322 0016451 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class WorkspaceStatisticsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Taskrouter/V1/Workspace/WorkflowOptions.php 0000644 00000031663 15107452322 0015044 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Options; use Twilio\Values; abstract class WorkflowOptions { /** * @param string $friendlyName descriptive string that you create to describe * the Workflow resource * @param string $assignmentCallbackUrl The URL from your application that will * process task assignment events * @param string $fallbackAssignmentCallbackUrl The URL that we should call * when a call to the * `assignment_callback_url` fails * @param string $configuration A JSON string that contains the rules to apply * to the Workflow * @param int $taskReservationTimeout How long TaskRouter will wait for a * confirmation response from your * application after it assigns a Task to a * Worker * @param string $reEvaluateTasks Whether or not to re-evaluate Tasks * @return UpdateWorkflowOptions Options builder */ public static function update(string $friendlyName = Values::NONE, string $assignmentCallbackUrl = Values::NONE, string $fallbackAssignmentCallbackUrl = Values::NONE, string $configuration = Values::NONE, int $taskReservationTimeout = Values::NONE, string $reEvaluateTasks = Values::NONE): UpdateWorkflowOptions { return new UpdateWorkflowOptions($friendlyName, $assignmentCallbackUrl, $fallbackAssignmentCallbackUrl, $configuration, $taskReservationTimeout, $reEvaluateTasks); } /** * @param string $friendlyName The friendly_name of the Workflow resources to * read * @return ReadWorkflowOptions Options builder */ public static function read(string $friendlyName = Values::NONE): ReadWorkflowOptions { return new ReadWorkflowOptions($friendlyName); } /** * @param string $assignmentCallbackUrl The URL from your application that will * process task assignment events * @param string $fallbackAssignmentCallbackUrl The URL that we should call * when a call to the * `assignment_callback_url` fails * @param int $taskReservationTimeout How long TaskRouter will wait for a * confirmation response from your * application after it assigns a Task to a * Worker * @return CreateWorkflowOptions Options builder */ public static function create(string $assignmentCallbackUrl = Values::NONE, string $fallbackAssignmentCallbackUrl = Values::NONE, int $taskReservationTimeout = Values::NONE): CreateWorkflowOptions { return new CreateWorkflowOptions($assignmentCallbackUrl, $fallbackAssignmentCallbackUrl, $taskReservationTimeout); } } class UpdateWorkflowOptions extends Options { /** * @param string $friendlyName descriptive string that you create to describe * the Workflow resource * @param string $assignmentCallbackUrl The URL from your application that will * process task assignment events * @param string $fallbackAssignmentCallbackUrl The URL that we should call * when a call to the * `assignment_callback_url` fails * @param string $configuration A JSON string that contains the rules to apply * to the Workflow * @param int $taskReservationTimeout How long TaskRouter will wait for a * confirmation response from your * application after it assigns a Task to a * Worker * @param string $reEvaluateTasks Whether or not to re-evaluate Tasks */ public function __construct(string $friendlyName = Values::NONE, string $assignmentCallbackUrl = Values::NONE, string $fallbackAssignmentCallbackUrl = Values::NONE, string $configuration = Values::NONE, int $taskReservationTimeout = Values::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 descriptive string that you create to describe * the Workflow resource * @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 * @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 * @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 * @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 * @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 . ']'; } } 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 CreateWorkflowOptions extends Options { /** * @param string $assignmentCallbackUrl The URL from your application that will * process task assignment events * @param string $fallbackAssignmentCallbackUrl The URL that we should call * when a call to the * `assignment_callback_url` fails * @param int $taskReservationTimeout How long TaskRouter will wait for a * confirmation response from your * application after it assigns a Task to a * Worker */ public function __construct(string $assignmentCallbackUrl = Values::NONE, string $fallbackAssignmentCallbackUrl = Values::NONE, int $taskReservationTimeout = Values::NONE) { $this->options['assignmentCallbackUrl'] = $assignmentCallbackUrl; $this->options['fallbackAssignmentCallbackUrl'] = $fallbackAssignmentCallbackUrl; $this->options['taskReservationTimeout'] = $taskReservationTimeout; } /** * The URL from your application that will process task assignment events. See [Handling Task Assignment Callback](https://www.twilio.com/docs/taskrouter/handle-assignment-callbacks) for more details. * * @param string $assignmentCallbackUrl The URL from your application that will * process task assignment events * @return $this Fluent Builder */ public function setAssignmentCallbackUrl(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 * @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 . ']'; } } Taskrouter/V1/Workspace/WorkerOptions.php 0000644 00000036023 15107452322 0014476 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Options; use Twilio\Values; abstract class WorkerOptions { /** * @param string $activityName The activity_name of the Worker resources to read * @param string $activitySid The activity_sid of the Worker resources to read * @param string $available Whether to return Worker resources that are * available or unavailable * @param string $friendlyName The friendly_name of the Worker resources to read * @param string $targetWorkersExpression Filter by Workers that would match an * expression on a TaskQueue * @param string $taskQueueName The friendly_name of the TaskQueue that the * Workers to read are eligible for * @param string $taskQueueSid The SID of the TaskQueue that the Workers to * read are eligible for * @param string $ordering Sorting parameter for Workers * @return ReadWorkerOptions Options builder */ public static function read(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): ReadWorkerOptions { return new ReadWorkerOptions($activityName, $activitySid, $available, $friendlyName, $targetWorkersExpression, $taskQueueName, $taskQueueSid, $ordering); } /** * @param string $activitySid The SID of a valid Activity that describes the * new Worker's initial state * @param string $attributes A valid JSON string that describes the new Worker * @return CreateWorkerOptions Options builder */ public static function create(string $activitySid = Values::NONE, string $attributes = Values::NONE): CreateWorkerOptions { return new CreateWorkerOptions($activitySid, $attributes); } /** * @param string $activitySid The SID of the Activity that describes the * Worker's initial state * @param string $attributes The JSON string that describes the Worker * @param string $friendlyName A string to describe the Worker * @param bool $rejectPendingReservations Whether to reject the Worker's * pending reservations * @param string $ifMatch The If-Match HTTP request header * @return UpdateWorkerOptions Options builder */ public static function update(string $activitySid = Values::NONE, string $attributes = Values::NONE, string $friendlyName = Values::NONE, bool $rejectPendingReservations = Values::NONE, string $ifMatch = Values::NONE): UpdateWorkerOptions { return new UpdateWorkerOptions($activitySid, $attributes, $friendlyName, $rejectPendingReservations, $ifMatch); } /** * @param string $ifMatch The If-Match HTTP request header * @return DeleteWorkerOptions Options builder */ public static function delete(string $ifMatch = Values::NONE): DeleteWorkerOptions { return new DeleteWorkerOptions($ifMatch); } } class ReadWorkerOptions extends Options { /** * @param string $activityName The activity_name of the Worker resources to read * @param string $activitySid The activity_sid of the Worker resources to read * @param string $available Whether to return Worker resources that are * available or unavailable * @param string $friendlyName The friendly_name of the Worker resources to read * @param string $targetWorkersExpression Filter by Workers that would match an * expression on a TaskQueue * @param string $taskQueueName The friendly_name of the TaskQueue that the * Workers to read are eligible for * @param string $taskQueueSid The SID of the TaskQueue that the Workers to * read are eligible for * @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 Worker resources that are * available or unavailable * @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 on a TaskQueue. This is helpful for debugging which Workers would match a potential queue. * * @param string $targetWorkersExpression Filter by Workers that would match an * expression on a TaskQueue * @return $this Fluent Builder */ public function setTargetWorkersExpression(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 CreateWorkerOptions extends Options { /** * @param string $activitySid The SID of a valid Activity that describes the * new Worker's initial state * @param string $attributes A valid JSON string that describes the new Worker */ public function __construct(string $activitySid = Values::NONE, string $attributes = Values::NONE) { $this->options['activitySid'] = $activitySid; $this->options['attributes'] = $attributes; } /** * The SID of a valid Activity that will describe the new Worker's initial state. See [Activities](https://www.twilio.com/docs/taskrouter/api/activity) for more information. If not provided, the new Worker's initial state is the `default_activity_sid` configured on the Workspace. * * @param string $activitySid The SID of a valid Activity that describes the * new Worker's initial state * @return $this Fluent Builder */ public function setActivitySid(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 * @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 UpdateWorkerOptions extends Options { /** * @param string $activitySid The SID of the Activity that describes the * Worker's initial state * @param string $attributes The JSON string that describes the Worker * @param string $friendlyName A string to describe the Worker * @param bool $rejectPendingReservations Whether to reject the Worker's * pending reservations * @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::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 the Activity that describes the * Worker's initial state * @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 * @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 string to describe the Worker * @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 * @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 . ']'; } } 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 . ']'; } } Taskrouter/V1/Workspace/ActivityOptions.php 0000644 00000013121 15107452322 0015013 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Options; use Twilio\Values; abstract class ActivityOptions { /** * @param string $friendlyName A string to describe the Activity resource * @return UpdateActivityOptions Options builder */ public static function update(string $friendlyName = Values::NONE): UpdateActivityOptions { return new UpdateActivityOptions($friendlyName); } /** * @param string $friendlyName The friendly_name of the Activity resources to * read * @param string $available Whether to return activities that are available or * unavailable * @return ReadActivityOptions Options builder */ public static function read(string $friendlyName = Values::NONE, string $available = Values::NONE): ReadActivityOptions { return new ReadActivityOptions($friendlyName, $available); } /** * @param bool $available Whether the Worker should be eligible to receive a * Task when it occupies the Activity * @return CreateActivityOptions Options builder */ public static function create(bool $available = Values::NONE): CreateActivityOptions { return new CreateActivityOptions($available); } } class UpdateActivityOptions extends Options { /** * @param string $friendlyName A string to describe the Activity resource */ 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 string to describe the Activity resource * @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 . ']'; } } class ReadActivityOptions extends Options { /** * @param string $friendlyName The friendly_name of the Activity resources to * read * @param string $available Whether to return activities that are available or * unavailable */ public function __construct(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 to return activities that are available or * 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 CreateActivityOptions extends Options { /** * @param bool $available Whether the Worker should be eligible to receive a * Task when it occupies the Activity */ public function __construct(bool $available = Values::NONE) { $this->options['available'] = $available; } /** * Whether the Worker should be eligible to receive a Task when it occupies the Activity. A value of `true`, `1`, or `yes` specifies the Activity is available. All other values specify that it is not. 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 * @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 . ']'; } } Taskrouter/V1/Workspace/EventList.php 0000644 00000013216 15107452322 0013565 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class EventList extends ListResource { /** * Construct the EventList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the Event */ public function __construct(Version $version, string $workspaceSid) { parent::__construct($version); // Path Solution $this->solution = ['workspaceSid' => $workspaceSid, ]; $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/Events'; } /** * Streams EventInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of EventInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 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]'; } } Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsOptions.php 0000644 00000003436 15107452322 0020663 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Options; use Twilio\Values; abstract class WorkspaceRealTimeStatisticsOptions { /** * @param string $taskChannel Only calculate real-time statistics on this * TaskChannel * @return FetchWorkspaceRealTimeStatisticsOptions Options builder */ public static function fetch(string $taskChannel = Values::NONE): FetchWorkspaceRealTimeStatisticsOptions { return new FetchWorkspaceRealTimeStatisticsOptions($taskChannel); } } class FetchWorkspaceRealTimeStatisticsOptions extends Options { /** * @param string $taskChannel Only calculate real-time statistics on this * TaskChannel */ public function __construct(string $taskChannel = Values::NONE) { $this->options['taskChannel'] = $taskChannel; } /** * Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * * @param string $taskChannel Only calculate real-time statistics on this * TaskChannel * @return $this Fluent Builder */ public function setTaskChannel(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 . ']'; } } Taskrouter/V1/Workspace/TaskContext.php 0000644 00000011574 15107452322 0014124 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Taskrouter\V1\Workspace\Task\ReservationList; use Twilio\Values; use Twilio\Version; /** * @property ReservationList $reservations * @method \Twilio\Rest\Taskrouter\V1\Workspace\Task\ReservationContext reservations(string $sid) */ class TaskContext extends InstanceContext { protected $_reservations; /** * Initialize the TaskContext * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the Task to fetch * @param string $sid The SID of the resource to fetch */ public function __construct(Version $version, $workspaceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['workspaceSid' => $workspaceSid, 'sid' => $sid, ]; $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/Tasks/' . \rawurlencode($sid) . ''; } /** * Fetch the TaskInstance * * @return TaskInstance Fetched TaskInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TaskInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $headers = Values::of(['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'] ); } /** * 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(['If-Match' => $options['ifMatch'], ]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * 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) . ']'; } } Taskrouter/V1/Workspace/Task/ReservationInstance.php 0000644 00000011061 15107452322 0016534 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Task; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $reservationStatus * @property string $sid * @property string $taskSid * @property string $workerName * @property string $workerSid * @property string $workspaceSid * @property string $url * @property array $links */ class ReservationInstance extends InstanceResource { /** * Initialize the ReservationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that this task is * contained within. * @param string $taskSid The SID of the reserved Task resource * @param string $sid The SID of the TaskReservation resource to fetch */ public function __construct(Version $version, array $payload, string $workspaceSid, string $taskSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Taskrouter/V1/Workspace/Task/ReservationOptions.php 0000644 00000147702 15107452322 0016437 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Task; use Twilio\Options; use Twilio\Values; abstract class ReservationOptions { /** * @param string $reservationStatus Returns the list of reservations for a task * with a specified ReservationStatus * @param string $workerSid The SID of the reserved Worker resource to read * @return ReadReservationOptions Options builder */ public static function read(string $reservationStatus = Values::NONE, string $workerSid = Values::NONE): ReadReservationOptions { return new ReadReservationOptions($reservationStatus, $workerSid); } /** * @param string $reservationStatus The new status of the reservation * @param string $workerActivitySid The new worker activity SID if rejecting a * reservation * @param string $instruction The assignment instruction for reservation * @param string $dequeuePostWorkActivitySid The SID of the Activity resource * to start after executing a Dequeue * instruction * @param string $dequeueFrom The Caller ID of the call to the worker when * executing a Dequeue instruction * @param string $dequeueRecord Whether to record both legs of a call when * executing a Dequeue instruction * @param int $dequeueTimeout Timeout for call when executing a Dequeue * instruction * @param string $dequeueTo The Contact URI of the worker when executing a * Dequeue instruction * @param string $dequeueStatusCallbackUrl The Callback URL for completed call * event when executing a Dequeue * instruction * @param string $callFrom The Caller ID of the outbound call when executing a * Call instruction * @param string $callRecord Whether to record both legs of a call when * executing a Call instruction * @param int $callTimeout Timeout for call when executing a Call instruction * @param string $callTo The Contact URI of the worker when executing a Call * instruction * @param string $callUrl TwiML URI executed on answering the worker's leg as a * result of the Call instruction * @param string $callStatusCallbackUrl The URL to call for the completed call * event when executing a Call instruction * @param bool $callAccept Whether to accept a reservation when executing a * Call instruction * @param string $redirectCallSid The Call SID of the call parked in the queue * when executing a Redirect instruction * @param bool $redirectAccept Whether the reservation should be accepted when * executing a Redirect instruction * @param string $redirectUrl TwiML URI to redirect the call to when executing * the Redirect instruction * @param string $to The Contact URI of the worker when executing a Conference * instruction * @param string $from The Caller ID of the call to the worker when executing a * Conference instruction * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @param string[] $statusCallbackEvent The call progress events that we will * send to status_callback * @param int $timeout Timeout for call when executing a Conference instruction * @param bool $record Whether to record the participant and their conferences * @param bool $muted Whether to mute the agent * @param string $beep Whether to play a notification beep when the participant * joins * @param bool $startConferenceOnEnter Whether the conference starts when the * participant joins the conference * @param bool $endConferenceOnExit Whether to end the conference when the * agent leaves * @param string $waitUrl URL that hosts pre-conference hold music * @param string $waitMethod The HTTP method we should use to call `wait_url` * @param bool $earlyMedia Whether agents can hear the state of the outbound * call * @param int $maxParticipants The maximum number of agent conference * participants * @param string $conferenceStatusCallback The callback URL for conference * events * @param string $conferenceStatusCallbackMethod HTTP method for requesting * `conference_status_callback` * URL * @param string[] $conferenceStatusCallbackEvent The conference status events * that we will send to * conference_status_callback * @param string $conferenceRecord Whether to record the conference the * participant is joining * @param string $conferenceTrim How to trim leading and trailing silence from * your recorded conference audio files * @param string $recordingChannels Specify `mono` or `dual` recording channels * @param string $recordingStatusCallback The URL that we should call using the * `recording_status_callback_method` * when the recording status changes * @param string $recordingStatusCallbackMethod The HTTP method we should use * when we call * `recording_status_callback` * @param string $conferenceRecordingStatusCallback The URL we should call * using the * `conference_recording_status_callback_method` when the conference recording is available * @param string $conferenceRecordingStatusCallbackMethod The HTTP method we * should use to call * `conference_recording_status_callback` * @param string $region The region where we should mix the conference audio * @param string $sipAuthUsername The SIP username used for authentication * @param string $sipAuthPassword The SIP password for authentication * @param string[] $dequeueStatusCallbackEvent The Call progress events sent * via webhooks as a result of a * Dequeue instruction * @param string $postWorkActivitySid The new worker activity SID after * executing a Conference instruction * @param string $supervisorMode The Supervisor mode when executing the * Supervise instruction * @param string $supervisor The Supervisor SID/URI when executing the * Supervise instruction * @param bool $endConferenceOnCustomerExit Whether to end the conference when * the customer leaves * @param bool $beepOnCustomerEntrance Whether to play a notification beep when * the customer joins * @param string $ifMatch The If-Match HTTP request header * @return UpdateReservationOptions Options builder */ public static function update(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::NONE, string $dequeueTo = Values::NONE, string $dequeueStatusCallbackUrl = Values::NONE, string $callFrom = Values::NONE, string $callRecord = Values::NONE, int $callTimeout = Values::NONE, string $callTo = Values::NONE, string $callUrl = Values::NONE, string $callStatusCallbackUrl = Values::NONE, bool $callAccept = Values::NONE, string $redirectCallSid = Values::NONE, bool $redirectAccept = Values::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::NONE, bool $record = Values::NONE, bool $muted = Values::NONE, string $beep = Values::NONE, bool $startConferenceOnEnter = Values::NONE, bool $endConferenceOnExit = Values::NONE, string $waitUrl = Values::NONE, string $waitMethod = Values::NONE, bool $earlyMedia = Values::NONE, int $maxParticipants = Values::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::NONE, bool $beepOnCustomerEntrance = Values::NONE, string $ifMatch = Values::NONE): UpdateReservationOptions { return new UpdateReservationOptions($reservationStatus, $workerActivitySid, $instruction, $dequeuePostWorkActivitySid, $dequeueFrom, $dequeueRecord, $dequeueTimeout, $dequeueTo, $dequeueStatusCallbackUrl, $callFrom, $callRecord, $callTimeout, $callTo, $callUrl, $callStatusCallbackUrl, $callAccept, $redirectCallSid, $redirectAccept, $redirectUrl, $to, $from, $statusCallback, $statusCallbackMethod, $statusCallbackEvent, $timeout, $record, $muted, $beep, $startConferenceOnEnter, $endConferenceOnExit, $waitUrl, $waitMethod, $earlyMedia, $maxParticipants, $conferenceStatusCallback, $conferenceStatusCallbackMethod, $conferenceStatusCallbackEvent, $conferenceRecord, $conferenceTrim, $recordingChannels, $recordingStatusCallback, $recordingStatusCallbackMethod, $conferenceRecordingStatusCallback, $conferenceRecordingStatusCallbackMethod, $region, $sipAuthUsername, $sipAuthPassword, $dequeueStatusCallbackEvent, $postWorkActivitySid, $supervisorMode, $supervisor, $endConferenceOnCustomerExit, $beepOnCustomerEntrance, $ifMatch); } } class ReadReservationOptions extends Options { /** * @param string $reservationStatus Returns the list of reservations for a task * with a specified ReservationStatus * @param string $workerSid The SID of the reserved Worker resource to read */ public function __construct(string $reservationStatus = Values::NONE, string $workerSid = Values::NONE) { $this->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 * @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 The new status of the reservation * @param string $workerActivitySid The new worker activity SID if rejecting a * reservation * @param string $instruction The assignment instruction for reservation * @param string $dequeuePostWorkActivitySid The SID of the Activity resource * to start after executing a Dequeue * instruction * @param string $dequeueFrom The Caller ID of the call to the worker when * executing a Dequeue instruction * @param string $dequeueRecord Whether to record both legs of a call when * executing a Dequeue instruction * @param int $dequeueTimeout Timeout for call when executing a Dequeue * instruction * @param string $dequeueTo The Contact URI of the worker when executing a * Dequeue instruction * @param string $dequeueStatusCallbackUrl The Callback URL for completed call * event when executing a Dequeue * instruction * @param string $callFrom The Caller ID of the outbound call when executing a * Call instruction * @param string $callRecord Whether to record both legs of a call when * executing a Call instruction * @param int $callTimeout Timeout for call when executing a Call instruction * @param string $callTo The Contact URI of the worker when executing a Call * instruction * @param string $callUrl TwiML URI executed on answering the worker's leg as a * result of the Call instruction * @param string $callStatusCallbackUrl The URL to call for the completed call * event when executing a Call instruction * @param bool $callAccept Whether to accept a reservation when executing a * Call instruction * @param string $redirectCallSid The Call SID of the call parked in the queue * when executing a Redirect instruction * @param bool $redirectAccept Whether the reservation should be accepted when * executing a Redirect instruction * @param string $redirectUrl TwiML URI to redirect the call to when executing * the Redirect instruction * @param string $to The Contact URI of the worker when executing a Conference * instruction * @param string $from The Caller ID of the call to the worker when executing a * Conference instruction * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @param string[] $statusCallbackEvent The call progress events that we will * send to status_callback * @param int $timeout Timeout for call when executing a Conference instruction * @param bool $record Whether to record the participant and their conferences * @param bool $muted Whether to mute the agent * @param string $beep Whether to play a notification beep when the participant * joins * @param bool $startConferenceOnEnter Whether the conference starts when the * participant joins the conference * @param bool $endConferenceOnExit Whether to end the conference when the * agent leaves * @param string $waitUrl URL that hosts pre-conference hold music * @param string $waitMethod The HTTP method we should use to call `wait_url` * @param bool $earlyMedia Whether agents can hear the state of the outbound * call * @param int $maxParticipants The maximum number of agent conference * participants * @param string $conferenceStatusCallback The callback URL for conference * events * @param string $conferenceStatusCallbackMethod HTTP method for requesting * `conference_status_callback` * URL * @param string[] $conferenceStatusCallbackEvent The conference status events * that we will send to * conference_status_callback * @param string $conferenceRecord Whether to record the conference the * participant is joining * @param string $conferenceTrim How to trim leading and trailing silence from * your recorded conference audio files * @param string $recordingChannels Specify `mono` or `dual` recording channels * @param string $recordingStatusCallback The URL that we should call using the * `recording_status_callback_method` * when the recording status changes * @param string $recordingStatusCallbackMethod The HTTP method we should use * when we call * `recording_status_callback` * @param string $conferenceRecordingStatusCallback The URL we should call * using the * `conference_recording_status_callback_method` when the conference recording is available * @param string $conferenceRecordingStatusCallbackMethod The HTTP method we * should use to call * `conference_recording_status_callback` * @param string $region The region where we should mix the conference audio * @param string $sipAuthUsername The SIP username used for authentication * @param string $sipAuthPassword The SIP password for authentication * @param string[] $dequeueStatusCallbackEvent The Call progress events sent * via webhooks as a result of a * Dequeue instruction * @param string $postWorkActivitySid The new worker activity SID after * executing a Conference instruction * @param string $supervisorMode The Supervisor mode when executing the * Supervise instruction * @param string $supervisor The Supervisor SID/URI when executing the * Supervise instruction * @param bool $endConferenceOnCustomerExit Whether to end the conference when * the customer leaves * @param bool $beepOnCustomerEntrance Whether to play a notification beep when * the customer joins * @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::NONE, string $dequeueTo = Values::NONE, string $dequeueStatusCallbackUrl = Values::NONE, string $callFrom = Values::NONE, string $callRecord = Values::NONE, int $callTimeout = Values::NONE, string $callTo = Values::NONE, string $callUrl = Values::NONE, string $callStatusCallbackUrl = Values::NONE, bool $callAccept = Values::NONE, string $redirectCallSid = Values::NONE, bool $redirectAccept = Values::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::NONE, bool $record = Values::NONE, bool $muted = Values::NONE, string $beep = Values::NONE, bool $startConferenceOnEnter = Values::NONE, bool $endConferenceOnExit = Values::NONE, string $waitUrl = Values::NONE, string $waitMethod = Values::NONE, bool $earlyMedia = Values::NONE, int $maxParticipants = Values::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::NONE, bool $beepOnCustomerEntrance = 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['ifMatch'] = $ifMatch; } /** * The new status of the reservation. Can be: `pending`, `accepted`, `rejected`, or `timeout`. * * @param string $reservationStatus The new status of the reservation * @return $this Fluent Builder */ public function setReservationStatus(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 * @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 * @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 * @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 * @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 * @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 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 * @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 * @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 * @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 to mute the agent * @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 * @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 the conference starts when the * participant joins 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 URL that hosts pre-conference hold music * @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` * @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 agents can hear the state of the outbound * call * @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 agent conference * participants * @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 callback URL for conference * events * @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 HTTP method for requesting * `conference_status_callback` * URL * @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 * @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 * @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 leading and trailing silence from * your recorded conference audio files * @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 Specify `mono` or `dual` recording channels * @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` * @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` * @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 where we should mix the conference audio * @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; } /** * The Supervisor mode when executing the Supervise instruction. * * @param string $supervisorMode The Supervisor mode when executing the * Supervise instruction * @return $this Fluent Builder */ public function setSupervisorMode(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 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 . ']'; } } Taskrouter/V1/Workspace/Task/ReservationList.php 0000644 00000013062 15107452322 0015706 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Task; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ReservationList extends ListResource { /** * Construct the ReservationList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that this task is * contained within. * @param string $taskSid The SID of the reserved Task resource */ public function __construct(Version $version, string $workspaceSid, string $taskSid) { parent::__construct($version); // Path Solution $this->solution = ['workspaceSid' => $workspaceSid, 'taskSid' => $taskSid, ]; $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/Tasks/' . \rawurlencode($taskSid) . '/Reservations'; } /** * Streams ReservationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of ReservationInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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]'; } } Taskrouter/V1/Workspace/Task/ReservationPage.php 0000644 00000002462 15107452322 0015651 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Task; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ReservationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Taskrouter/V1/Workspace/Task/ReservationContext.php 0000644 00000015035 15107452322 0016421 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Task; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class ReservationContext extends InstanceContext { /** * Initialize the ReservationContext * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the * TaskReservation resource to fetch * @param string $taskSid The SID of the reserved Task resource with the * TaskReservation resource to fetch * @param string $sid The SID of the TaskReservation resource to fetch */ public function __construct(Version $version, $workspaceSid, $taskSid, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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' => Serialize::map($options['statusCallbackEvent'], function($e) { return $e; }), 'Timeout' => $options['timeout'], 'Record' => Serialize::booleanToString($options['record']), 'Muted' => Serialize::booleanToString($options['muted']), 'Beep' => $options['beep'], 'StartConferenceOnEnter' => Serialize::booleanToString($options['startConferenceOnEnter']), 'EndConferenceOnExit' => Serialize::booleanToString($options['endConferenceOnExit']), 'WaitUrl' => $options['waitUrl'], 'WaitMethod' => $options['waitMethod'], 'EarlyMedia' => Serialize::booleanToString($options['earlyMedia']), 'MaxParticipants' => $options['maxParticipants'], 'ConferenceStatusCallback' => $options['conferenceStatusCallback'], 'ConferenceStatusCallbackMethod' => $options['conferenceStatusCallbackMethod'], 'ConferenceStatusCallbackEvent' => Serialize::map($options['conferenceStatusCallbackEvent'], function($e) { return $e; }), 'ConferenceRecord' => $options['conferenceRecord'], 'ConferenceTrim' => $options['conferenceTrim'], 'RecordingChannels' => $options['recordingChannels'], 'RecordingStatusCallback' => $options['recordingStatusCallback'], 'RecordingStatusCallbackMethod' => $options['recordingStatusCallbackMethod'], 'ConferenceRecordingStatusCallback' => $options['conferenceRecordingStatusCallback'], 'ConferenceRecordingStatusCallbackMethod' => $options['conferenceRecordingStatusCallbackMethod'], 'Region' => $options['region'], 'SipAuthUsername' => $options['sipAuthUsername'], 'SipAuthPassword' => $options['sipAuthPassword'], 'DequeueStatusCallbackEvent' => Serialize::map($options['dequeueStatusCallbackEvent'], function($e) { return $e; }), 'PostWorkActivitySid' => $options['postWorkActivitySid'], 'SupervisorMode' => $options['supervisorMode'], 'Supervisor' => $options['supervisor'], 'EndConferenceOnCustomerExit' => Serialize::booleanToString($options['endConferenceOnCustomerExit']), 'BeepOnCustomerEntrance' => Serialize::booleanToString($options['beepOnCustomerEntrance']), ]); $headers = Values::of(['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) . ']'; } } Taskrouter/V1/Workspace/WorkerInstance.php 0000644 00000014250 15107452322 0014605 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Taskrouter\V1\Workspace\Worker\ReservationList; use Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkerChannelList; use Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkerStatisticsList; use Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersCumulativeStatisticsList; use Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersRealTimeStatisticsList; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $activityName * @property string $activitySid * @property string $attributes * @property bool $available * @property \DateTime $dateCreated * @property \DateTime $dateStatusChanged * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $sid * @property string $workspaceSid * @property string $url * @property array $links */ class WorkerInstance extends InstanceResource { protected $_realTimeStatistics; protected $_cumulativeStatistics; protected $_statistics; protected $_reservations; protected $_workerChannels; /** * Initialize the WorkerInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the Worker * @param string $sid The SID of the resource to fetch */ public function __construct(Version $version, array $payload, string $workspaceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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); } /** * Access the realTimeStatistics */ protected function getRealTimeStatistics(): WorkersRealTimeStatisticsList { return $this->proxy()->realTimeStatistics; } /** * Access the cumulativeStatistics */ protected function getCumulativeStatistics(): WorkersCumulativeStatisticsList { return $this->proxy()->cumulativeStatistics; } /** * Access the statistics */ protected function getStatistics(): WorkerStatisticsList { return $this->proxy()->statistics; } /** * Access the reservations */ protected function getReservations(): ReservationList { return $this->proxy()->reservations; } /** * Access the workerChannels */ protected function getWorkerChannels(): WorkerChannelList { return $this->proxy()->workerChannels; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Taskrouter/V1/Workspace/WorkspaceStatisticsList.php 0000644 00000002151 15107452322 0016511 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\ListResource; use Twilio\Version; class WorkspaceStatisticsList extends ListResource { /** * Construct the WorkspaceStatisticsList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace */ public function __construct(Version $version, string $workspaceSid) { parent::__construct($version); // Path Solution $this->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]'; } } Taskrouter/V1/Workspace/ActivityPage.php 0000644 00000002300 15107452322 0014231 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ActivityPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsPage.php 0000644 00000002554 15107452322 0020520 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class WorkspaceCumulativeStatisticsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsInstance.php 0000644 00000010101 15107452322 0020757 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property array[] $activityStatistics * @property int $longestTaskWaitingAge * @property string $longestTaskWaitingSid * @property array $tasksByPriority * @property array $tasksByStatus * @property int $totalTasks * @property int $totalWorkers * @property string $workspaceSid * @property string $url */ class WorkspaceRealTimeStatisticsInstance extends InstanceResource { /** * Initialize the WorkspaceRealTimeStatisticsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace */ public function __construct(Version $version, array $payload, string $workspaceSid) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsInstance.php 0000644 00000013007 15107452322 0021403 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property int $avgTaskAcceptanceTime * @property \DateTime $startTime * @property \DateTime $endTime * @property int $reservationsCreated * @property int $reservationsAccepted * @property int $reservationsRejected * @property int $reservationsTimedOut * @property int $reservationsCanceled * @property int $reservationsRescinded * @property array $splitByWaitTime * @property array $waitDurationUntilAccepted * @property array $waitDurationUntilCanceled * @property int $tasksCanceled * @property int $tasksCompleted * @property int $tasksCreated * @property int $tasksDeleted * @property int $tasksMoved * @property int $tasksTimedOutInWorkflow * @property string $workspaceSid * @property string $url */ class WorkspaceCumulativeStatisticsInstance extends InstanceResource { /** * Initialize the WorkspaceCumulativeStatisticsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace */ public function __construct(Version $version, array $payload, string $workspaceSid) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Taskrouter/V1/Workspace/EventPage.php 0000644 00000002256 15107452322 0013530 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class EventPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Taskrouter/V1/Workspace/ActivityList.php 0000644 00000014062 15107452322 0014300 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ActivityList extends ListResource { /** * Construct the ActivityList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the * Activity */ public function __construct(Version $version, string $workspaceSid) { parent::__construct($version); // Path Solution $this->solution = ['workspaceSid' => $workspaceSid, ]; $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/Activities'; } /** * Streams ActivityInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of ActivityInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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); } /** * Create the ActivityInstance * * @param string $friendlyName A string to describe the Activity resource * @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']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ActivityInstance($this->version, $payload, $this->solution['workspaceSid']); } /** * Constructs a ActivityContext * * @param string $sid The SID of the resource to fetch */ 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]'; } } Taskrouter/V1/Workspace/WorkerContext.php 0000644 00000017104 15107452322 0014466 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Taskrouter\V1\Workspace\Worker\ReservationList; use Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkerChannelList; use Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkerStatisticsList; use Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersCumulativeStatisticsList; use Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersRealTimeStatisticsList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property WorkersRealTimeStatisticsList $realTimeStatistics * @property WorkersCumulativeStatisticsList $cumulativeStatistics * @property WorkerStatisticsList $statistics * @property ReservationList $reservations * @property WorkerChannelList $workerChannels * @method \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersRealTimeStatisticsContext realTimeStatistics() * @method \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersCumulativeStatisticsContext cumulativeStatistics() * @method \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkerStatisticsContext statistics() * @method \Twilio\Rest\Taskrouter\V1\Workspace\Worker\ReservationContext reservations(string $sid) * @method \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkerChannelContext workerChannels(string $sid) */ class WorkerContext extends InstanceContext { protected $_realTimeStatistics; protected $_cumulativeStatistics; protected $_statistics; protected $_reservations; protected $_workerChannels; /** * Initialize the WorkerContext * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the Worker to fetch * @param string $sid The SID of the resource to fetch */ public function __construct(Version $version, $workspaceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['workspaceSid' => $workspaceSid, 'sid' => $sid, ]; $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/Workers/' . \rawurlencode($sid) . ''; } /** * Fetch the WorkerInstance * * @return WorkerInstance Fetched WorkerInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WorkerInstance { $payload = $this->version->fetch('GET', $this->uri); 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(['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'] ); } /** * 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(['If-Match' => $options['ifMatch'], ]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * Access the realTimeStatistics */ protected function getRealTimeStatistics(): WorkersRealTimeStatisticsList { if (!$this->_realTimeStatistics) { $this->_realTimeStatistics = new WorkersRealTimeStatisticsList( $this->version, $this->solution['workspaceSid'] ); } return $this->_realTimeStatistics; } /** * Access the cumulativeStatistics */ protected function getCumulativeStatistics(): WorkersCumulativeStatisticsList { if (!$this->_cumulativeStatistics) { $this->_cumulativeStatistics = new WorkersCumulativeStatisticsList( $this->version, $this->solution['workspaceSid'] ); } return $this->_cumulativeStatistics; } /** * 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 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 workerChannels */ protected function getWorkerChannels(): WorkerChannelList { if (!$this->_workerChannels) { $this->_workerChannels = new WorkerChannelList( $this->version, $this->solution['workspaceSid'], $this->solution['sid'] ); } return $this->_workerChannels; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return 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) . ']'; } } Taskrouter/V1/Workspace/TaskQueuePage.php 0000644 00000002306 15107452322 0014352 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class TaskQueuePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Taskrouter/V1/Workspace/TaskInstance.php 0000644 00000013623 15107452322 0014241 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Taskrouter\V1\Workspace\Task\ReservationList; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property int $age * @property string $assignmentStatus * @property string $attributes * @property string $addons * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property \DateTime $taskQueueEnteredDate * @property int $priority * @property string $reason * @property string $sid * @property string $taskQueueSid * @property string $taskQueueFriendlyName * @property string $taskChannelSid * @property string $taskChannelUniqueName * @property int $timeout * @property string $workflowSid * @property string $workflowFriendlyName * @property string $workspaceSid * @property string $url * @property array $links */ class TaskInstance extends InstanceResource { protected $_reservations; /** * Initialize the TaskInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the Task * @param string $sid The SID of the resource to fetch */ public function __construct(Version $version, array $payload, string $workspaceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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'), ]; $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; } /** * 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); } /** * 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); } /** * 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) . ']'; } } Taskrouter/V1/Workspace/TaskChannelInstance.php 0000644 00000011043 15107452322 0015524 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $sid * @property string $uniqueName * @property string $workspaceSid * @property bool $channelOptimizedRouting * @property string $url * @property array $links */ class TaskChannelInstance extends InstanceResource { /** * Initialize the TaskChannelInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the Task * Channel * @param string $sid The SID of the Task Channel resource to fetch */ public function __construct(Version $version, array $payload, string $workspaceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Taskrouter/V1/Workspace/WorkerList.php 0000644 00000017740 15107452322 0013763 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersStatisticsList; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * @property WorkersStatisticsList $statistics * @method \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersStatisticsContext statistics() */ class WorkerList extends ListResource { protected $_statistics = null; /** * Construct the WorkerList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the Worker */ public function __construct(Version $version, string $workspaceSid) { parent::__construct($version); // Path Solution $this->solution = ['workspaceSid' => $workspaceSid, ]; $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/Workers'; } /** * Streams WorkerInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of WorkerInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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); } /** * Create the WorkerInstance * * @param string $friendlyName A string to describe the resource * @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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new WorkerInstance($this->version, $payload, $this->solution['workspaceSid']); } /** * Access the statistics */ protected function getStatistics(): WorkersStatisticsList { if (!$this->_statistics) { $this->_statistics = new WorkersStatisticsList($this->version, $this->solution['workspaceSid']); } return $this->_statistics; } /** * Constructs a WorkerContext * * @param string $sid The SID of the resource to fetch */ public function getContext(string $sid): WorkerContext { return new WorkerContext($this->version, $this->solution['workspaceSid'], $sid); } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(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]'; } } Taskrouter/V1/Workspace/TaskQueueContext.php 0000644 00000014520 15107452322 0015123 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueCumulativeStatisticsList; use Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueRealTimeStatisticsList; use Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueStatisticsList; use Twilio\Values; use Twilio\Version; /** * @property TaskQueueStatisticsList $statistics * @property TaskQueueRealTimeStatisticsList $realTimeStatistics * @property TaskQueueCumulativeStatisticsList $cumulativeStatistics * @method \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueStatisticsContext statistics() * @method \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueRealTimeStatisticsContext realTimeStatistics() * @method \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueCumulativeStatisticsContext cumulativeStatistics() */ class TaskQueueContext extends InstanceContext { protected $_statistics; protected $_realTimeStatistics; protected $_cumulativeStatistics; /** * Initialize the TaskQueueContext * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the TaskQueue to * fetch * @param string $sid The SID of the resource to */ public function __construct(Version $version, $workspaceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['workspaceSid' => $workspaceSid, 'sid' => $sid, ]; $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/TaskQueues/' . \rawurlencode($sid) . ''; } /** * Fetch the TaskQueueInstance * * @return TaskQueueInstance Fetched TaskQueueInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TaskQueueInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new TaskQueueInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['sid'] ); } /** * Delete the TaskQueueInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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; } /** * 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; } /** * 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) . ']'; } } Taskrouter/V1/Workspace/TaskQueueOptions.php 0000644 00000037405 15107452322 0015141 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Options; use Twilio\Values; abstract class TaskQueueOptions { /** * @param string $friendlyName A string to describe the resource * @param string $targetWorkers A string describing the Worker selection * criteria for any Tasks that enter the TaskQueue * @param string $reservationActivitySid The SID of the Activity to assign * Workers when a task is reserved for * them * @param string $assignmentActivitySid The SID of the Activity to assign * Workers when a task is assigned for them * @param int $maxReservedWorkers The maximum number of Workers to create * reservations for the assignment of a task * while in the queue * @param string $taskOrder How Tasks will be assigned to Workers * @return UpdateTaskQueueOptions Options builder */ public static function update(string $friendlyName = Values::NONE, string $targetWorkers = Values::NONE, string $reservationActivitySid = Values::NONE, string $assignmentActivitySid = Values::NONE, int $maxReservedWorkers = Values::NONE, string $taskOrder = Values::NONE): UpdateTaskQueueOptions { return new UpdateTaskQueueOptions($friendlyName, $targetWorkers, $reservationActivitySid, $assignmentActivitySid, $maxReservedWorkers, $taskOrder); } /** * @param string $friendlyName The friendly_name of the TaskQueue resources to * read * @param string $evaluateWorkerAttributes The attributes of the Workers to read * @param string $workerSid The SID of the Worker with the TaskQueue resources * to read * @param string $ordering Sorting parameter for TaskQueues * @return ReadTaskQueueOptions Options builder */ public static function read(string $friendlyName = Values::NONE, string $evaluateWorkerAttributes = Values::NONE, string $workerSid = Values::NONE, string $ordering = Values::NONE): ReadTaskQueueOptions { return new ReadTaskQueueOptions($friendlyName, $evaluateWorkerAttributes, $workerSid, $ordering); } /** * @param string $targetWorkers A string describing the Worker selection * criteria for any Tasks that enter the TaskQueue * @param int $maxReservedWorkers The maximum number of Workers to reserve * @param string $taskOrder How Tasks will be assigned to Workers * @param string $reservationActivitySid The SID of the Activity to assign * Workers when a task is reserved for * them * @param string $assignmentActivitySid The SID of the Activity to assign * Workers once a task is assigned to them * @return CreateTaskQueueOptions Options builder */ public static function create(string $targetWorkers = Values::NONE, int $maxReservedWorkers = Values::NONE, string $taskOrder = Values::NONE, string $reservationActivitySid = Values::NONE, string $assignmentActivitySid = Values::NONE): CreateTaskQueueOptions { return new CreateTaskQueueOptions($targetWorkers, $maxReservedWorkers, $taskOrder, $reservationActivitySid, $assignmentActivitySid); } } class UpdateTaskQueueOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $targetWorkers A string describing the Worker selection * criteria for any Tasks that enter the TaskQueue * @param string $reservationActivitySid The SID of the Activity to assign * Workers when a task is reserved for * them * @param string $assignmentActivitySid The SID of the Activity to assign * Workers when a task is assigned for them * @param int $maxReservedWorkers The maximum number of Workers to create * reservations for the assignment of a task * while in the queue * @param string $taskOrder How Tasks will be assigned to Workers */ public function __construct(string $friendlyName = Values::NONE, string $targetWorkers = Values::NONE, string $reservationActivitySid = Values::NONE, string $assignmentActivitySid = Values::NONE, int $maxReservedWorkers = Values::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 string to describe the resource * @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 * @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 * @return $this Fluent Builder */ public function setMaxReservedWorkers(int $maxReservedWorkers): self { $this->options['maxReservedWorkers'] = $maxReservedWorkers; return $this; } /** * How Tasks will be assigned to Workers. Can be: `FIFO` or `LIFO` and the default is `FIFO`. Use `FIFO` to assign the oldest task first and `LIFO` to assign the most recent task first. For more information, see [Queue Ordering](https://www.twilio.com/docs/taskrouter/queue-ordering-last-first-out-lifo). * * @param string $taskOrder How Tasks will be assigned to Workers * @return $this Fluent Builder */ public function setTaskOrder(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 . ']'; } } class ReadTaskQueueOptions extends Options { /** * @param string $friendlyName The friendly_name of the TaskQueue resources to * read * @param string $evaluateWorkerAttributes The attributes of the Workers to read * @param string $workerSid The SID of the Worker with the TaskQueue resources * to read * @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 * @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 CreateTaskQueueOptions extends Options { /** * @param string $targetWorkers A string describing the Worker selection * criteria for any Tasks that enter the TaskQueue * @param int $maxReservedWorkers The maximum number of Workers to reserve * @param string $taskOrder How Tasks will be assigned to Workers * @param string $reservationActivitySid The SID of the Activity to assign * Workers when a task is reserved for * them * @param string $assignmentActivitySid The SID of the Activity to assign * Workers once a task is assigned to them */ public function __construct(string $targetWorkers = Values::NONE, int $maxReservedWorkers = Values::NONE, string $taskOrder = Values::NONE, string $reservationActivitySid = Values::NONE, string $assignmentActivitySid = Values::NONE) { $this->options['targetWorkers'] = $targetWorkers; $this->options['maxReservedWorkers'] = $maxReservedWorkers; $this->options['taskOrder'] = $taskOrder; $this->options['reservationActivitySid'] = $reservationActivitySid; $this->options['assignmentActivitySid'] = $assignmentActivitySid; } /** * A string that describes the Worker selection criteria for any Tasks that enter the TaskQueue. For example, `'"language" == "spanish"'`. The default value is `1==1`. If this value is empty, Tasks will wait in the TaskQueue until they are deleted or moved to another TaskQueue. For more information about Worker selection, see [Describing Worker selection criteria](https://www.twilio.com/docs/taskrouter/api/taskqueues#target-workers). * * @param string $targetWorkers A string describing the Worker selection * criteria for any Tasks that enter the TaskQueue * @return $this Fluent Builder */ public function setTargetWorkers(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 * @return $this Fluent Builder */ public function setMaxReservedWorkers(int $maxReservedWorkers): self { $this->options['maxReservedWorkers'] = $maxReservedWorkers; return $this; } /** * How Tasks will be assigned to Workers. Set this parameter to `LIFO` to assign most recently created Task first or FIFO to assign the oldest Task first. Default is `FIFO`. [Click here](https://www.twilio.com/docs/taskrouter/queue-ordering-last-first-out-lifo) to learn more. * * @param string $taskOrder How Tasks will be assigned to Workers * @return $this Fluent Builder */ public function setTaskOrder(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 once 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 . ']'; } } Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsList.php 0000644 00000002245 15107452322 0020554 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\ListResource; use Twilio\Version; class WorkspaceCumulativeStatisticsList extends ListResource { /** * Construct the WorkspaceCumulativeStatisticsList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace */ public function __construct(Version $version, string $workspaceSid) { parent::__construct($version); // Path Solution $this->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]'; } } Taskrouter/V1/Workspace/EventOptions.php 0000644 00000020617 15107452322 0014310 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Options; use Twilio\Values; abstract class EventOptions { /** * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param string $eventType The type of Events to read * @param int $minutes The period of events to read in minutes * @param string $reservationSid The SID of the Reservation with the Events to * read * @param \DateTime $startDate Only include Events from on or after this date * @param string $taskQueueSid The SID of the TaskQueue with the Events to read * @param string $taskSid The SID of the Task with the Events to read * @param string $workerSid The SID of the Worker with the Events to read * @param string $workflowSid The SID of the Worker with the Events to read * @param string $taskChannel The TaskChannel with the Events to read * @param string $sid The unique string that identifies the resource * @return ReadEventOptions Options builder */ public static function read(\DateTime $endDate = Values::NONE, string $eventType = Values::NONE, int $minutes = Values::NONE, string $reservationSid = Values::NONE, \DateTime $startDate = Values::NONE, string $taskQueueSid = Values::NONE, string $taskSid = Values::NONE, string $workerSid = Values::NONE, string $workflowSid = Values::NONE, string $taskChannel = Values::NONE, string $sid = Values::NONE): ReadEventOptions { return new ReadEventOptions($endDate, $eventType, $minutes, $reservationSid, $startDate, $taskQueueSid, $taskSid, $workerSid, $workflowSid, $taskChannel, $sid); } } class ReadEventOptions extends Options { /** * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param string $eventType The type of Events to read * @param int $minutes The period of events to read in minutes * @param string $reservationSid The SID of the Reservation with the Events to * read * @param \DateTime $startDate Only include Events from on or after this date * @param string $taskQueueSid The SID of the TaskQueue with the Events to read * @param string $taskSid The SID of the Task with the Events to read * @param string $workerSid The SID of the Worker with the Events to read * @param string $workflowSid The SID of the Worker with the Events to read * @param string $taskChannel The TaskChannel with the Events to read * @param string $sid The unique string that identifies the resource */ public function __construct(\DateTime $endDate = Values::NONE, string $eventType = Values::NONE, int $minutes = Values::NONE, string $reservationSid = Values::NONE, \DateTime $startDate = Values::NONE, string $taskQueueSid = Values::NONE, string $taskSid = Values::NONE, string $workerSid = Values::NONE, string $workflowSid = Values::NONE, string $taskChannel = Values::NONE, string $sid = Values::NONE) { $this->options['endDate'] = $endDate; $this->options['eventType'] = $eventType; $this->options['minutes'] = $minutes; $this->options['reservationSid'] = $reservationSid; $this->options['startDate'] = $startDate; $this->options['taskQueueSid'] = $taskQueueSid; $this->options['taskSid'] = $taskSid; $this->options['workerSid'] = $workerSid; $this->options['workflowSid'] = $workflowSid; $this->options['taskChannel'] = $taskChannel; $this->options['sid'] = $sid; } /** * Only include Events that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * * @param \DateTime $endDate Only include usage that occurred on or before this * date * @return $this Fluent Builder */ public function setEndDate(\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 * @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 * @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 * @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 * @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 * @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 * @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 * @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 Worker with the Events to read * @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 * @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 unique string that identifies the resource * @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 . ']'; } } Taskrouter/V1/Workspace/EventContext.php 0000644 00000003325 15107452322 0014276 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class EventContext extends InstanceContext { /** * Initialize the EventContext * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the Event to fetch * @param string $sid The SID of the resource to fetch */ public function __construct(Version $version, $workspaceSid, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Taskrouter/V1/Workspace/WorkspaceStatisticsContext.php 0000644 00000004212 15107452322 0017222 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class WorkspaceStatisticsContext extends InstanceContext { /** * Initialize the WorkspaceStatisticsContext * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace to fetch */ public function __construct(Version $version, $workspaceSid) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->fetch('GET', $this->uri, $params); return new WorkspaceStatisticsInstance($this->version, $payload, $this->solution['workspaceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkspaceStatisticsContext ' . \implode(' ', $context) . ']'; } } Taskrouter/V1/Workspace/WorkflowList.php 0000644 00000014614 15107452322 0014321 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class WorkflowList extends ListResource { /** * Construct the WorkflowList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the * Workflow */ public function __construct(Version $version, string $workspaceSid) { parent::__construct($version); // Path Solution $this->solution = ['workspaceSid' => $workspaceSid, ]; $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/Workflows'; } /** * Streams WorkflowInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of WorkflowInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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); } /** * Create the WorkflowInstance * * @param string $friendlyName descriptive string that you create to describe * the Workflow resource * @param string $configuration A JSON string that contains the rules to apply * to the Workflow * @param array|Options $options Optional Arguments * @return WorkflowInstance 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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new WorkflowInstance($this->version, $payload, $this->solution['workspaceSid']); } /** * Constructs a WorkflowContext * * @param string $sid The SID of the resource */ 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]'; } } Taskrouter/V1/Workspace/TaskOptions.php 0000644 00000050726 15107452323 0014136 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Options; use Twilio\Values; abstract class TaskOptions { /** * @param string $attributes The JSON string that describes the custom * attributes of the task * @param string $assignmentStatus The new status of the task * @param string $reason The reason that the Task was canceled or complete * @param int $priority The Task's new priority value * @param string $taskChannel When MultiTasking is enabled, specify the * TaskChannel with the task to update * @param string $ifMatch The If-Match HTTP request header * @return UpdateTaskOptions Options builder */ public static function update(string $attributes = Values::NONE, string $assignmentStatus = Values::NONE, string $reason = Values::NONE, int $priority = Values::NONE, string $taskChannel = Values::NONE, string $ifMatch = Values::NONE): UpdateTaskOptions { return new UpdateTaskOptions($attributes, $assignmentStatus, $reason, $priority, $taskChannel, $ifMatch); } /** * @param string $ifMatch The If-Match HTTP request header * @return DeleteTaskOptions Options builder */ public static function delete(string $ifMatch = Values::NONE): DeleteTaskOptions { return new DeleteTaskOptions($ifMatch); } /** * @param int $priority The priority value of the Tasks to read * @param string[] $assignmentStatus Returns the list of all Tasks in the * Workspace with the specified * assignment_status * @param string $workflowSid The SID of the Workflow with the Tasks to read * @param string $workflowName The friendly name of the Workflow with the Tasks * to read * @param string $taskQueueSid The SID of the TaskQueue with the Tasks to read * @param string $taskQueueName The friendly_name of the TaskQueue with the * Tasks to read * @param string $evaluateTaskAttributes The task attributes of the Tasks to * read * @param string $ordering Controls the order of the Tasks returned * @param bool $hasAddons Whether to read Tasks with addons * @return ReadTaskOptions Options builder */ public static function read(int $priority = Values::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 $ordering = Values::NONE, bool $hasAddons = Values::NONE): ReadTaskOptions { return new ReadTaskOptions($priority, $assignmentStatus, $workflowSid, $workflowName, $taskQueueSid, $taskQueueName, $evaluateTaskAttributes, $ordering, $hasAddons); } /** * @param int $timeout The amount of time in seconds the task can live before * being assigned * @param int $priority The priority to assign the new task and override the * default * @param string $taskChannel When MultiTasking is enabled specify the * TaskChannel by passing either its unique_name or * SID * @param string $workflowSid The SID of the Workflow that you would like to * handle routing for the new Task * @param string $attributes A URL-encoded JSON string describing the * attributes of the task * @return CreateTaskOptions Options builder */ public static function create(int $timeout = Values::NONE, int $priority = Values::NONE, string $taskChannel = Values::NONE, string $workflowSid = Values::NONE, string $attributes = Values::NONE): CreateTaskOptions { return new CreateTaskOptions($timeout, $priority, $taskChannel, $workflowSid, $attributes); } } class UpdateTaskOptions extends Options { /** * @param string $attributes The JSON string that describes the custom * attributes of the task * @param string $assignmentStatus The new status of the task * @param string $reason The reason that the Task was canceled or complete * @param int $priority The Task's new priority value * @param string $taskChannel When MultiTasking is enabled, specify the * TaskChannel with the task to update * @param string $ifMatch The If-Match HTTP request header */ public function __construct(string $attributes = Values::NONE, string $assignmentStatus = Values::NONE, string $reason = Values::NONE, int $priority = Values::NONE, string $taskChannel = Values::NONE, 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['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; } /** * The new status of the task. Can be: `canceled`, to cancel a Task that is currently `pending` or `reserved`; `wrapping`, to move the Task to wrapup state; or `completed`, to move a Task to the completed state. * * @param string $assignmentStatus The new status of the task * @return $this Fluent Builder */ public function setAssignmentStatus(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 complete * @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 * @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 * @return $this Fluent Builder */ public function setTaskChannel(string $taskChannel): self { $this->options['taskChannel'] = $taskChannel; 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 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.UpdateTaskOptions ' . $options . ']'; } } class DeleteTaskOptions extends Options { /** * @param string $ifMatch The If-Match HTTP request header */ 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 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.DeleteTaskOptions ' . $options . ']'; } } class ReadTaskOptions extends Options { /** * @param int $priority The priority value of the Tasks to read * @param string[] $assignmentStatus Returns the list of all Tasks in the * Workspace with the specified * assignment_status * @param string $workflowSid The SID of the Workflow with the Tasks to read * @param string $workflowName The friendly name of the Workflow with the Tasks * to read * @param string $taskQueueSid The SID of the TaskQueue with the Tasks to read * @param string $taskQueueName The friendly_name of the TaskQueue with the * Tasks to read * @param string $evaluateTaskAttributes The task attributes of the Tasks to * read * @param string $ordering Controls the order of the Tasks returned * @param bool $hasAddons Whether to read Tasks with addons */ public function __construct(int $priority = Values::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 $ordering = Values::NONE, bool $hasAddons = Values::NONE) { $this->options['priority'] = $priority; $this->options['assignmentStatus'] = $assignmentStatus; $this->options['workflowSid'] = $workflowSid; $this->options['workflowName'] = $workflowName; $this->options['taskQueueSid'] = $taskQueueSid; $this->options['taskQueueName'] = $taskQueueName; $this->options['evaluateTaskAttributes'] = $evaluateTaskAttributes; $this->options['ordering'] = $ordering; $this->options['hasAddons'] = $hasAddons; } /** * The priority value of the Tasks to read. Returns the list of all Tasks in the Workspace with the specified priority. * * @param int $priority The priority value of the Tasks to read * @return $this Fluent Builder */ public function setPriority(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 Returns the list of 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 * @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 * @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 * @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 * @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 task attributes of the Tasks to * read * @return $this Fluent Builder */ public function setEvaluateTaskAttributes(string $evaluateTaskAttributes): self { $this->options['evaluateTaskAttributes'] = $evaluateTaskAttributes; return $this; } /** * How to order the returned Task resources. y default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `Priority` or `DateCreated` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Multiple sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. * * @param string $ordering Controls the order of the Tasks returned * @return $this Fluent Builder */ public function setOrdering(string $ordering): self { $this->options['ordering'] = $ordering; return $this; } /** * Whether to read Tasks with addons. If `true`, returns only Tasks with addons. If `false`, returns only Tasks without addons. * * @param bool $hasAddons Whether to read Tasks with addons * @return $this Fluent Builder */ public function setHasAddons(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 CreateTaskOptions extends Options { /** * @param int $timeout The amount of time in seconds the task can live before * being assigned * @param int $priority The priority to assign the new task and override the * default * @param string $taskChannel When MultiTasking is enabled specify the * TaskChannel by passing either its unique_name or * SID * @param string $workflowSid The SID of the Workflow that you would like to * handle routing for the new Task * @param string $attributes A URL-encoded JSON string describing the * attributes of the task */ public function __construct(int $timeout = Values::NONE, int $priority = Values::NONE, string $taskChannel = Values::NONE, string $workflowSid = Values::NONE, string $attributes = Values::NONE) { $this->options['timeout'] = $timeout; $this->options['priority'] = $priority; $this->options['taskChannel'] = $taskChannel; $this->options['workflowSid'] = $workflowSid; $this->options['attributes'] = $attributes; } /** * The amount of time in seconds the new task 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 task can live before * being assigned * @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 * @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 * @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 * @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 describing the * attributes of the task * @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.CreateTaskOptions ' . $options . ']'; } } Taskrouter/V1/Workspace/WorkflowInstance.php 0000644 00000013412 15107452323 0015146 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowCumulativeStatisticsList; use Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowRealTimeStatisticsList; use Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowStatisticsList; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $assignmentCallbackUrl * @property string $configuration * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $documentContentType * @property string $fallbackAssignmentCallbackUrl * @property string $friendlyName * @property string $sid * @property int $taskReservationTimeout * @property string $workspaceSid * @property string $url * @property array $links */ class WorkflowInstance extends InstanceResource { protected $_statistics; protected $_realTimeStatistics; protected $_cumulativeStatistics; /** * Initialize the WorkflowInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the * Workflow * @param string $sid The SID of the resource */ public function __construct(Version $version, array $payload, string $workspaceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Access the statistics */ protected function getStatistics(): WorkflowStatisticsList { return $this->proxy()->statistics; } /** * Access the realTimeStatistics */ protected function getRealTimeStatistics(): WorkflowRealTimeStatisticsList { return $this->proxy()->realTimeStatistics; } /** * Access the cumulativeStatistics */ protected function getCumulativeStatistics(): WorkflowCumulativeStatisticsList { 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.WorkflowInstance ' . \implode(' ', $context) . ']'; } } Taskrouter/V1/Workspace/ActivityInstance.php 0000644 00000010516 15107452323 0015132 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property bool $available * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $sid * @property string $workspaceSid * @property string $url * @property array $links */ class ActivityInstance extends InstanceResource { /** * Initialize the ActivityInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the * Activity * @param string $sid The SID of the resource to fetch */ public function __construct(Version $version, array $payload, string $workspaceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Taskrouter/V1/Workspace/WorkspaceStatisticsOptions.php 0000644 00000013073 15107452323 0017237 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Options; use Twilio\Values; abstract class WorkspaceStatisticsOptions { /** * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param \DateTime $endDate Only calculate statistics from this date and time * and earlier * @param string $taskChannel Only calculate statistics on this TaskChannel. * @param string $splitByWaitTime A comma separated list of values that * describes the thresholds to calculate * statistics on * @return FetchWorkspaceStatisticsOptions Options builder */ public static function fetch(int $minutes = Values::NONE, \DateTime $startDate = Values::NONE, \DateTime $endDate = Values::NONE, string $taskChannel = Values::NONE, string $splitByWaitTime = Values::NONE): FetchWorkspaceStatisticsOptions { return new FetchWorkspaceStatisticsOptions($minutes, $startDate, $endDate, $taskChannel, $splitByWaitTime); } } class FetchWorkspaceStatisticsOptions extends Options { /** * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param \DateTime $endDate Only calculate statistics from this date and time * and earlier * @param string $taskChannel Only calculate statistics on this TaskChannel. * @param string $splitByWaitTime A comma separated list of values that * describes the thresholds to calculate * statistics on */ public function __construct(int $minutes = Values::NONE, \DateTime $startDate = Values::NONE, \DateTime $endDate = Values::NONE, string $taskChannel = Values::NONE, string $splitByWaitTime = Values::NONE) { $this->options['minutes'] = $minutes; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['taskChannel'] = $taskChannel; $this->options['splitByWaitTime'] = $splitByWaitTime; } /** * Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. * * @param int $minutes Only calculate statistics since this many minutes in the * past * @return $this Fluent Builder */ public function setMinutes(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 on or after this * date * @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 * @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. * @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 to calculate * statistics on * @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 . ']'; } } Taskrouter/V1/Workspace/TaskChannelContext.php 0000644 00000005673 15107452323 0015421 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class TaskChannelContext extends InstanceContext { /** * Initialize the TaskChannelContext * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the Task Channel * to fetch * @param string $sid The SID of the Task Channel resource to fetch */ public function __construct(Version $version, $workspaceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['workspaceSid' => $workspaceSid, 'sid' => $sid, ]; $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/TaskChannels/' . \rawurlencode($sid) . ''; } /** * Fetch the TaskChannelInstance * * @return TaskChannelInstance Fetched TaskChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TaskChannelInstance { $payload = $this->version->fetch('GET', $this->uri); 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']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new TaskChannelInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['sid'] ); } /** * Delete the TaskChannelInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Taskrouter/V1/Workspace/WorkflowContext.php 0000644 00000014512 15107452323 0015030 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowCumulativeStatisticsList; use Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowRealTimeStatisticsList; use Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowStatisticsList; use Twilio\Values; use Twilio\Version; /** * @property WorkflowStatisticsList $statistics * @property WorkflowRealTimeStatisticsList $realTimeStatistics * @property WorkflowCumulativeStatisticsList $cumulativeStatistics * @method \Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowStatisticsContext statistics() * @method \Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowRealTimeStatisticsContext realTimeStatistics() * @method \Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowCumulativeStatisticsContext cumulativeStatistics() */ class WorkflowContext extends InstanceContext { protected $_statistics; protected $_realTimeStatistics; protected $_cumulativeStatistics; /** * Initialize the WorkflowContext * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the Workflow to * fetch * @param string $sid The SID of the resource */ public function __construct(Version $version, $workspaceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['workspaceSid' => $workspaceSid, 'sid' => $sid, ]; $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/Workflows/' . \rawurlencode($sid) . ''; } /** * Fetch the WorkflowInstance * * @return WorkflowInstance Fetched WorkflowInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WorkflowInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new WorkflowInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['sid'] ); } /** * Delete the WorkflowInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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 realTimeStatistics */ protected function getRealTimeStatistics(): WorkflowRealTimeStatisticsList { if (!$this->_realTimeStatistics) { $this->_realTimeStatistics = new WorkflowRealTimeStatisticsList( $this->version, $this->solution['workspaceSid'], $this->solution['sid'] ); } return $this->_realTimeStatistics; } /** * 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; } /** * 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) . ']'; } } Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsInstance.php 0000644 00000007320 15107452323 0021034 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Workflow; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property array $cumulative * @property array $realtime * @property string $workflowSid * @property string $workspaceSid * @property string $url */ class WorkflowStatisticsInstance extends InstanceResource { /** * Initialize the WorkflowStatisticsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the * Workflow * @param string $workflowSid Returns the list of Tasks that are being * controlled by the Workflow with the specified SID * value */ public function __construct(Version $version, array $payload, string $workspaceSid, string $workflowSid) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsOptions.php 0000644 00000003441 15107452323 0022346 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Workflow; use Twilio\Options; use Twilio\Values; abstract class WorkflowRealTimeStatisticsOptions { /** * @param string $taskChannel Only calculate real-time statistics on this * TaskChannel * @return FetchWorkflowRealTimeStatisticsOptions Options builder */ public static function fetch(string $taskChannel = Values::NONE): FetchWorkflowRealTimeStatisticsOptions { return new FetchWorkflowRealTimeStatisticsOptions($taskChannel); } } class FetchWorkflowRealTimeStatisticsOptions extends Options { /** * @param string $taskChannel Only calculate real-time statistics on this * TaskChannel */ public function __construct(string $taskChannel = Values::NONE) { $this->options['taskChannel'] = $taskChannel; } /** * Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * * @param string $taskChannel Only calculate real-time statistics on this * TaskChannel * @return $this Fluent Builder */ public function setTaskChannel(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 . ']'; } } Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsContext.php 0000644 00000005312 15107452323 0022752 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Workflow; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class WorkflowCumulativeStatisticsContext extends InstanceContext { /** * Initialize the WorkflowCumulativeStatisticsContext * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the resource to * fetch * @param string $workflowSid Returns the list of Tasks that are being * controlled by the Workflow with the specified Sid * value */ public function __construct(Version $version, $workspaceSid, $workflowSid) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->fetch('GET', $this->uri, $params); return new WorkflowCumulativeStatisticsInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['workflowSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkflowCumulativeStatisticsContext ' . \implode(' ', $context) . ']'; } } Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsOptions.php 0000644 00000013554 15107452323 0022770 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Workflow; use Twilio\Options; use Twilio\Values; abstract class WorkflowCumulativeStatisticsOptions { /** * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param string $taskChannel Only calculate cumulative statistics on this * TaskChannel * @param string $splitByWaitTime A comma separated list of values that * describes the thresholds, in seconds, to * calculate statistics on * @return FetchWorkflowCumulativeStatisticsOptions Options builder */ public static function fetch(\DateTime $endDate = Values::NONE, int $minutes = Values::NONE, \DateTime $startDate = Values::NONE, string $taskChannel = Values::NONE, string $splitByWaitTime = Values::NONE): FetchWorkflowCumulativeStatisticsOptions { return new FetchWorkflowCumulativeStatisticsOptions($endDate, $minutes, $startDate, $taskChannel, $splitByWaitTime); } } class FetchWorkflowCumulativeStatisticsOptions extends Options { /** * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param string $taskChannel Only calculate cumulative statistics on this * TaskChannel * @param string $splitByWaitTime A comma separated list of values that * describes the thresholds, in seconds, to * calculate statistics on */ public function __construct(\DateTime $endDate = Values::NONE, int $minutes = Values::NONE, \DateTime $startDate = Values::NONE, string $taskChannel = Values::NONE, string $splitByWaitTime = Values::NONE) { $this->options['endDate'] = $endDate; $this->options['minutes'] = $minutes; $this->options['startDate'] = $startDate; $this->options['taskChannel'] = $taskChannel; $this->options['splitByWaitTime'] = $splitByWaitTime; } /** * Only include usage that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * * @param \DateTime $endDate Only include usage that occurred on or before this * date * @return $this Fluent Builder */ public function setEndDate(\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 * @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 on or after this * date * @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 * @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 * @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 . ']'; } } Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsList.php 0000644 00000003044 15107452323 0021625 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Workflow; use Twilio\ListResource; use Twilio\Version; class WorkflowRealTimeStatisticsList extends ListResource { /** * Construct the WorkflowRealTimeStatisticsList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the * Workflow. * @param string $workflowSid Returns the list of Tasks that are being * controlled by the Workflow with the specified SID * value */ public function __construct(Version $version, string $workspaceSid, string $workflowSid) { parent::__construct($version); // Path Solution $this->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]'; } } Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsPage.php 0000644 00000002630 15107452323 0021566 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Workflow; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class WorkflowRealTimeStatisticsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsInstance.php 0000644 00000013730 15107452323 0023075 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Workflow; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property int $avgTaskAcceptanceTime * @property \DateTime $startTime * @property \DateTime $endTime * @property int $reservationsCreated * @property int $reservationsAccepted * @property int $reservationsRejected * @property int $reservationsTimedOut * @property int $reservationsCanceled * @property int $reservationsRescinded * @property array $splitByWaitTime * @property array $waitDurationUntilAccepted * @property array $waitDurationUntilCanceled * @property int $tasksCanceled * @property int $tasksCompleted * @property int $tasksEntered * @property int $tasksDeleted * @property int $tasksMoved * @property int $tasksTimedOutInWorkflow * @property string $workflowSid * @property string $workspaceSid * @property string $url */ class WorkflowCumulativeStatisticsInstance extends InstanceResource { /** * Initialize the WorkflowCumulativeStatisticsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the * Workflow. * @param string $workflowSid Returns the list of Tasks that are being * controlled by the Workflow with the specified Sid * value */ public function __construct(Version $version, array $payload, string $workspaceSid, string $workflowSid) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsContext.php 0000644 00000005074 15107452323 0020720 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Workflow; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class WorkflowStatisticsContext extends InstanceContext { /** * Initialize the WorkflowStatisticsContext * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the Workflow to * fetch * @param string $workflowSid Returns the list of Tasks that are being * controlled by the Workflow with the specified SID * value */ public function __construct(Version $version, $workspaceSid, $workflowSid) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->fetch('GET', $this->uri, $params); return new WorkflowStatisticsInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['workflowSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkflowStatisticsContext ' . \implode(' ', $context) . ']'; } } Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsContext.php 0000644 00000004607 15107452323 0022344 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Workflow; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class WorkflowRealTimeStatisticsContext extends InstanceContext { /** * Initialize the WorkflowRealTimeStatisticsContext * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the Workflow to * fetch * @param string $workflowSid Returns the list of Tasks that are being * controlled by the Workflow with the specified SID * value */ public function __construct(Version $version, $workspaceSid, $workflowSid) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->fetch('GET', $this->uri, $params); return new WorkflowRealTimeStatisticsInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['workflowSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkflowRealTimeStatisticsContext ' . \implode(' ', $context) . ']'; } } Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsPage.php 0000644 00000002644 15107452323 0022207 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Workflow; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class WorkflowCumulativeStatisticsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsInstance.php 0000644 00000010446 15107452323 0022462 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Workflow; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property int $longestTaskWaitingAge * @property string $longestTaskWaitingSid * @property array $tasksByPriority * @property array $tasksByStatus * @property int $totalTasks * @property string $workflowSid * @property string $workspaceSid * @property string $url */ class WorkflowRealTimeStatisticsInstance extends InstanceResource { /** * Initialize the WorkflowRealTimeStatisticsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the * Workflow. * @param string $workflowSid Returns the list of Tasks that are being * controlled by the Workflow with the specified SID * value */ public function __construct(Version $version, array $payload, string $workspaceSid, string $workflowSid) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsOptions.php 0000644 00000013314 15107452323 0020723 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Workflow; use Twilio\Options; use Twilio\Values; abstract class WorkflowStatisticsOptions { /** * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param \DateTime $endDate Only calculate statistics from this date and time * and earlier * @param string $taskChannel Only calculate real-time statistics on this * TaskChannel. * @param string $splitByWaitTime A comma separated list of values that * describes the thresholds to calculate * statistics on * @return FetchWorkflowStatisticsOptions Options builder */ public static function fetch(int $minutes = Values::NONE, \DateTime $startDate = Values::NONE, \DateTime $endDate = Values::NONE, string $taskChannel = Values::NONE, string $splitByWaitTime = Values::NONE): FetchWorkflowStatisticsOptions { return new FetchWorkflowStatisticsOptions($minutes, $startDate, $endDate, $taskChannel, $splitByWaitTime); } } class FetchWorkflowStatisticsOptions extends Options { /** * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param \DateTime $endDate Only calculate statistics from this date and time * and earlier * @param string $taskChannel Only calculate real-time statistics on this * TaskChannel. * @param string $splitByWaitTime A comma separated list of values that * describes the thresholds to calculate * statistics on */ public function __construct(int $minutes = Values::NONE, \DateTime $startDate = Values::NONE, \DateTime $endDate = Values::NONE, string $taskChannel = Values::NONE, string $splitByWaitTime = Values::NONE) { $this->options['minutes'] = $minutes; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['taskChannel'] = $taskChannel; $this->options['splitByWaitTime'] = $splitByWaitTime; } /** * Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. * * @param int $minutes Only calculate statistics since this many minutes in the * past * @return $this Fluent Builder */ public function setMinutes(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 on or after this * date * @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 * @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. * @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 to calculate * statistics on * @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 . ']'; } } Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsList.php 0000644 00000003060 15107452323 0022237 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Workflow; use Twilio\ListResource; use Twilio\Version; class WorkflowCumulativeStatisticsList extends ListResource { /** * Construct the WorkflowCumulativeStatisticsList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the * Workflow. * @param string $workflowSid Returns the list of Tasks that are being * controlled by the Workflow with the specified Sid * value */ public function __construct(Version $version, string $workspaceSid, string $workflowSid) { parent::__construct($version); // Path Solution $this->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]'; } } Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsList.php 0000644 00000002763 15107452323 0020211 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Workflow; use Twilio\ListResource; use Twilio\Version; class WorkflowStatisticsList extends ListResource { /** * Construct the WorkflowStatisticsList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the * Workflow * @param string $workflowSid Returns the list of Tasks that are being * controlled by the Workflow with the specified SID * value */ public function __construct(Version $version, string $workspaceSid, string $workflowSid) { parent::__construct($version); // Path Solution $this->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]'; } } Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsPage.php 0000644 00000002550 15107452323 0020144 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Workflow; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class WorkflowStatisticsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Taskrouter/V1/Workspace/TaskQueueList.php 0000644 00000017773 15107452323 0014430 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueuesStatisticsList; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * @property TaskQueuesStatisticsList $statistics */ class TaskQueueList extends ListResource { protected $_statistics = null; /** * Construct the TaskQueueList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the * TaskQueue */ public function __construct(Version $version, string $workspaceSid) { parent::__construct($version); // Path Solution $this->solution = ['workspaceSid' => $workspaceSid, ]; $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/TaskQueues'; } /** * Streams TaskQueueInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of TaskQueueInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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); } /** * Create the TaskQueueInstance * * @param string $friendlyName A string to describe the resource * @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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new TaskQueueInstance($this->version, $payload, $this->solution['workspaceSid']); } /** * Access the statistics */ protected function getStatistics(): TaskQueuesStatisticsList { if (!$this->_statistics) { $this->_statistics = new TaskQueuesStatisticsList($this->version, $this->solution['workspaceSid']); } return $this->_statistics; } /** * Constructs a TaskQueueContext * * @param string $sid The SID of the resource to */ public function getContext(string $sid): TaskQueueContext { return new TaskQueueContext($this->version, $this->solution['workspaceSid'], $sid); } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(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]'; } } Taskrouter/V1/Workspace/EventInstance.php 0000644 00000010671 15107452323 0014421 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $actorSid * @property string $actorType * @property string $actorUrl * @property string $description * @property array $eventData * @property \DateTime $eventDate * @property string $eventDateMs * @property string $eventType * @property string $resourceSid * @property string $resourceType * @property string $resourceUrl * @property string $sid * @property string $source * @property string $sourceIpAddress * @property string $url * @property string $workspaceSid */ class EventInstance extends InstanceResource { /** * Initialize the EventInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the Event * @param string $sid The SID of the resource to fetch */ public function __construct(Version $version, array $payload, string $workspaceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Taskrouter/V1/Workspace/TaskList.php 0000644 00000014642 15107452323 0013413 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class TaskList extends ListResource { /** * Construct the TaskList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the Task */ public function __construct(Version $version, string $workspaceSid) { parent::__construct($version); // Path Solution $this->solution = ['workspaceSid' => $workspaceSid, ]; $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/Tasks'; } /** * Streams TaskInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of TaskInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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'], '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); } /** * 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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new TaskInstance($this->version, $payload, $this->solution['workspaceSid']); } /** * Constructs a TaskContext * * @param string $sid The SID of the resource to fetch */ 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]'; } } Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsOptions.php 0000644 00000013551 15107452323 0021277 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Options; use Twilio\Values; abstract class WorkspaceCumulativeStatisticsOptions { /** * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param string $taskChannel Only calculate cumulative statistics on this * TaskChannel * @param string $splitByWaitTime A comma separated list of values that * describes the thresholds, in seconds, to * calculate statistics on * @return FetchWorkspaceCumulativeStatisticsOptions Options builder */ public static function fetch(\DateTime $endDate = Values::NONE, int $minutes = Values::NONE, \DateTime $startDate = Values::NONE, string $taskChannel = Values::NONE, string $splitByWaitTime = Values::NONE): FetchWorkspaceCumulativeStatisticsOptions { return new FetchWorkspaceCumulativeStatisticsOptions($endDate, $minutes, $startDate, $taskChannel, $splitByWaitTime); } } class FetchWorkspaceCumulativeStatisticsOptions extends Options { /** * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param string $taskChannel Only calculate cumulative statistics on this * TaskChannel * @param string $splitByWaitTime A comma separated list of values that * describes the thresholds, in seconds, to * calculate statistics on */ public function __construct(\DateTime $endDate = Values::NONE, int $minutes = Values::NONE, \DateTime $startDate = Values::NONE, string $taskChannel = Values::NONE, string $splitByWaitTime = Values::NONE) { $this->options['endDate'] = $endDate; $this->options['minutes'] = $minutes; $this->options['startDate'] = $startDate; $this->options['taskChannel'] = $taskChannel; $this->options['splitByWaitTime'] = $splitByWaitTime; } /** * Only include usage that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * * @param \DateTime $endDate Only include usage that occurred on or before this * date * @return $this Fluent Builder */ public function setEndDate(\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 * @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 on or after this * date * @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 * @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 * @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 . ']'; } } Taskrouter/V1/Workspace/ActivityContext.php 0000644 00000005363 15107452323 0015016 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class ActivityContext extends InstanceContext { /** * Initialize the ActivityContext * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the Activity * resources to fetch * @param string $sid The SID of the resource to fetch */ public function __construct(Version $version, $workspaceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['workspaceSid' => $workspaceSid, 'sid' => $sid, ]; $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/Activities/' . \rawurlencode($sid) . ''; } /** * Fetch the ActivityInstance * * @return ActivityInstance Fetched ActivityInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ActivityInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ActivityInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['sid'] ); } /** * Delete the ActivityInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsContext.php 0000644 00000004507 15107452323 0021271 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class WorkspaceCumulativeStatisticsContext extends InstanceContext { /** * Initialize the WorkspaceCumulativeStatisticsContext * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace to fetch */ public function __construct(Version $version, $workspaceSid) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->fetch('GET', $this->uri, $params); return new WorkspaceCumulativeStatisticsInstance( $this->version, $payload, $this->solution['workspaceSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkspaceCumulativeStatisticsContext ' . \implode(' ', $context) . ']'; } } Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsList.php 0000644 00000002231 15107452323 0020134 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\ListResource; use Twilio\Version; class WorkspaceRealTimeStatisticsList extends ListResource { /** * Construct the WorkspaceRealTimeStatisticsList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace */ public function __construct(Version $version, string $workspaceSid) { parent::__construct($version); // Path Solution $this->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]'; } } Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsPage.php 0000644 00000002540 15107452323 0020100 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class WorkspaceRealTimeStatisticsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Taskrouter/V1/Workspace/TaskChannelList.php 0000644 00000013670 15107452323 0014704 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class TaskChannelList extends ListResource { /** * Construct the TaskChannelList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the Task * Channel */ public function __construct(Version $version, string $workspaceSid) { parent::__construct($version); // Path Solution $this->solution = ['workspaceSid' => $workspaceSid, ]; $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/TaskChannels'; } /** * Streams TaskChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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); } /** * Create the TaskChannelInstance * * @param string $friendlyName A string to describe the Task Channel resource * @param string $uniqueName An application-defined string that uniquely * identifies the Task Channel * @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']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new TaskChannelInstance($this->version, $payload, $this->solution['workspaceSid']); } /** * Constructs a TaskChannelContext * * @param string $sid The SID of the Task Channel resource to fetch */ 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]'; } } Taskrouter/V1/Workspace/TaskChannelOptions.php 0000644 00000010354 15107452323 0015420 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Options; use Twilio\Values; abstract class TaskChannelOptions { /** * @param string $friendlyName A string to describe the Task Channel resource * @param bool $channelOptimizedRouting Whether the TaskChannel should * prioritize Workers that have been idle * @return UpdateTaskChannelOptions Options builder */ public static function update(string $friendlyName = Values::NONE, bool $channelOptimizedRouting = Values::NONE): UpdateTaskChannelOptions { return new UpdateTaskChannelOptions($friendlyName, $channelOptimizedRouting); } /** * @param bool $channelOptimizedRouting Whether the Task Channel should * prioritize Workers that have been idle * @return CreateTaskChannelOptions Options builder */ public static function create(bool $channelOptimizedRouting = Values::NONE): CreateTaskChannelOptions { return new CreateTaskChannelOptions($channelOptimizedRouting); } } class UpdateTaskChannelOptions extends Options { /** * @param string $friendlyName A string to describe the Task Channel resource * @param bool $channelOptimizedRouting Whether the TaskChannel should * prioritize Workers that have been idle */ public function __construct(string $friendlyName = Values::NONE, bool $channelOptimizedRouting = Values::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 string to describe the Task Channel resource * @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 * @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 . ']'; } } class CreateTaskChannelOptions extends Options { /** * @param bool $channelOptimizedRouting Whether the Task Channel should * prioritize Workers that have been idle */ public function __construct(bool $channelOptimizedRouting = Values::NONE) { $this->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 * @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 . ']'; } } Taskrouter/V1/Workspace/TaskPage.php 0000644 00000002250 15107452323 0013344 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class TaskPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Taskrouter/V1/Workspace/TaskChannelPage.php 0000644 00000002322 15107452323 0014635 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class TaskChannelPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsContext.php 0000644 00000004004 15107452324 0020646 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class WorkspaceRealTimeStatisticsContext extends InstanceContext { /** * Initialize the WorkspaceRealTimeStatisticsContext * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace to fetch */ public function __construct(Version $version, $workspaceSid) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->fetch('GET', $this->uri, $params); return new WorkspaceRealTimeStatisticsInstance( $this->version, $payload, $this->solution['workspaceSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkspaceRealTimeStatisticsContext ' . \implode(' ', $context) . ']'; } } Taskrouter/V1/Workspace/WorkspaceStatisticsInstance.php 0000644 00000006372 15107452324 0017355 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property array $realtime * @property array $cumulative * @property string $accountSid * @property string $workspaceSid * @property string $url */ class WorkspaceStatisticsInstance extends InstanceResource { /** * Initialize the WorkspaceStatisticsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace */ public function __construct(Version $version, array $payload, string $workspaceSid) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Taskrouter/V1/Workspace/WorkflowPage.php 0000644 00000002300 15107452324 0014251 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class WorkflowPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Taskrouter/V1.php 0000644 00000004314 15107452324 0007713 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Taskrouter\V1\WorkspaceList; use Twilio\Version; /** * @property WorkspaceList $workspaces * @method \Twilio\Rest\Taskrouter\V1\WorkspaceContext workspaces(string $sid) */ class V1 extends Version { protected $_workspaces; /** * Construct the V1 version of Taskrouter * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->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]'; } } Numbers.php 0000644 00000004401 15107452324 0006672 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Numbers\V2; /** * @property \Twilio\Rest\Numbers\V2 $v2 * @property \Twilio\Rest\Numbers\V2\RegulatoryComplianceList $regulatoryCompliance */ class Numbers extends Domain { protected $_v2; /** * Construct the Numbers Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://numbers.twilio.com'; } /** * @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); } protected function getRegulatoryCompliance(): \Twilio\Rest\Numbers\V2\RegulatoryComplianceList { return $this->v2->regulatoryCompliance; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Numbers]'; } } Pricing/V1/MessagingPage.php 0000644 00000002210 15107452324 0011646 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MessagingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Pricing/V1/PhoneNumber/CountryInstance.php 0000644 00000006014 15107452324 0014514 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1\PhoneNumber; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $country * @property string $isoCountry * @property string[] $phoneNumberPrices * @property string $priceUnit * @property string $url */ class CountryInstance extends InstanceResource { /** * Initialize the CountryInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $isoCountry The ISO country code */ public function __construct(Version $version, array $payload, string $isoCountry = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Pricing/V1/PhoneNumber/CountryPage.php 0000644 00000002224 15107452324 0013623 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1\PhoneNumber; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CountryPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Pricing/V1/PhoneNumber/CountryContext.php 0000644 00000003000 15107452324 0014364 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1\PhoneNumber; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class CountryContext extends InstanceContext { /** * Initialize the CountryContext * * @param Version $version Version that contains the resource * @param string $isoCountry The ISO country code */ public function __construct(Version $version, $isoCountry) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } }Pricing/V1/PhoneNumber/CountryList.php 0000644 00000011023 15107452324 0013657 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1\PhoneNumber; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class CountryList extends ListResource { /** * Construct the CountryList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/PhoneNumbers/Countries'; } /** * Streams CountryInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 */ 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]'; } } Pricing/V1/VoiceList.php 0000644 00000005355 15107452324 0011052 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Pricing\V1\Voice\CountryList; use Twilio\Rest\Pricing\V1\Voice\NumberList; use Twilio\Version; /** * @property NumberList $numbers * @property CountryList $countries * @method \Twilio\Rest\Pricing\V1\Voice\NumberContext numbers(string $number) * @method \Twilio\Rest\Pricing\V1\Voice\CountryContext countries(string $isoCountry) */ class VoiceList extends ListResource { protected $_numbers = null; protected $_countries = null; /** * Construct the VoiceList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; } /** * Access the numbers */ protected function getNumbers(): NumberList { if (!$this->_numbers) { $this->_numbers = new NumberList($this->version); } return $this->_numbers; } /** * 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.VoiceList]'; } } Pricing/V1/MessagingList.php 0000644 00000004530 15107452324 0011714 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Pricing\V1\Messaging\CountryList; use Twilio\Version; /** * @property CountryList $countries * @method \Twilio\Rest\Pricing\V1\Messaging\CountryContext countries(string $isoCountry) */ class MessagingList extends ListResource { protected $_countries = null; /** * Construct the MessagingList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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]'; } } Pricing/V1/PhoneNumberPage.php 0000644 00000002224 15107452324 0012160 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class PhoneNumberPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Pricing/V1/Messaging/CountryInstance.php 0000644 00000006207 15107452324 0014213 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1\Messaging; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $country * @property string $isoCountry * @property string[] $outboundSmsPrices * @property string[] $inboundSmsPrices * @property string $priceUnit * @property string $url */ class CountryInstance extends InstanceResource { /** * Initialize the CountryInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $isoCountry The ISO country code */ public function __construct(Version $version, array $payload, string $isoCountry = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Pricing/V1/Messaging/CountryPage.php 0000644 00000002220 15107452324 0013312 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1\Messaging; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CountryPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Pricing/V1/Messaging/CountryContext.php 0000644 00000002773 15107452324 0014077 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1\Messaging; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class CountryContext extends InstanceContext { /** * Initialize the CountryContext * * @param Version $version Version that contains the resource * @param string $isoCountry The ISO country code */ public function __construct(Version $version, $isoCountry) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Pricing/V1/Messaging/CountryList.php 0000644 00000011016 15107452324 0013354 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1\Messaging; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class CountryList extends ListResource { /** * Construct the CountryList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Messaging/Countries'; } /** * Streams CountryInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 */ 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]'; } } Pricing/V1/VoicePage.php 0000644 00000002160 15107452324 0011002 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class VoicePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Pricing/V1/VoiceInstance.php 0000644 00000003351 15107452324 0011675 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $name * @property string $url * @property array $links */ class VoiceInstance extends InstanceResource { /** * Initialize the VoiceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'name' => Values::array_get($payload, 'name'), '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.Pricing.V1.VoiceInstance]'; } } Pricing/V1/PhoneNumberList.php 0000644 00000004542 15107452324 0012224 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Pricing\V1\PhoneNumber\CountryList; use Twilio\Version; /** * @property CountryList $countries * @method \Twilio\Rest\Pricing\V1\PhoneNumber\CountryContext countries(string $isoCountry) */ class PhoneNumberList extends ListResource { protected $_countries = null; /** * Construct the PhoneNumberList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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]'; } } Pricing/V1/MessagingInstance.php 0000644 00000003365 15107452324 0012552 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $name * @property string $url * @property array $links */ class MessagingInstance extends InstanceResource { /** * Initialize the MessagingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'name' => Values::array_get($payload, 'name'), '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.Pricing.V1.MessagingInstance]'; } } Pricing/V1/Voice/CountryInstance.php 0000644 00000006217 15107452324 0013344 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1\Voice; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $country * @property string $isoCountry * @property string[] $outboundPrefixPrices * @property string[] $inboundCallPrices * @property string $priceUnit * @property string $url */ class CountryInstance extends InstanceResource { /** * Initialize the CountryInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $isoCountry The ISO country code */ public function __construct(Version $version, array $payload, string $isoCountry = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Pricing/V1/Voice/CountryPage.php 0000644 00000002210 15107452324 0012441 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1\Voice; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CountryPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Pricing/V1/Voice/NumberPage.php 0000644 00000002202 15107452324 0012227 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1\Voice; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class NumberPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Pricing/V1/Voice/CountryContext.php 0000644 00000002763 15107452324 0013226 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1\Voice; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class CountryContext extends InstanceContext { /** * Initialize the CountryContext * * @param Version $version Version that contains the resource * @param string $isoCountry The ISO country code */ public function __construct(Version $version, $isoCountry) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Pricing/V1/Voice/CountryList.php 0000644 00000011006 15107452324 0012503 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1\Voice; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class CountryList extends ListResource { /** * Construct the CountryList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Voice/Countries'; } /** * Streams CountryInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 */ 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]'; } } Pricing/V1/Voice/NumberList.php 0000644 00000001722 15107452324 0012274 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1\Voice; use Twilio\ListResource; use Twilio\Version; class NumberList extends ListResource { /** * Construct the NumberList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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]'; } } Pricing/V1/Voice/NumberContext.php 0000644 00000002726 15107452324 0013012 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1\Voice; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class NumberContext extends InstanceContext { /** * Initialize the NumberContext * * @param Version $version Version that contains the resource * @param string $number The phone number to fetch */ public function __construct(Version $version, $number) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Pricing/V1/Voice/NumberInstance.php 0000644 00000006274 15107452324 0013134 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1\Voice; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $number * @property string $country * @property string $isoCountry * @property string $outboundCallPrice * @property string $inboundCallPrice * @property string $priceUnit * @property string $url */ class NumberInstance extends InstanceResource { /** * Initialize the NumberInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $number The phone number to fetch */ public function __construct(Version $version, array $payload, string $number = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Pricing/V1/PhoneNumberInstance.php 0000644 00000003373 15107452324 0013056 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $name * @property string $url * @property array $links */ class PhoneNumberInstance extends InstanceResource { /** * Initialize the PhoneNumberInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'name' => Values::array_get($payload, 'name'), '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.Pricing.V1.PhoneNumberInstance]'; } } Pricing/V1.php 0000644 00000005277 15107452324 0007154 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Pricing\V1\MessagingList; use Twilio\Rest\Pricing\V1\PhoneNumberList; use Twilio\Rest\Pricing\V1\VoiceList; use Twilio\Version; /** * @property MessagingList $messaging * @property PhoneNumberList $phoneNumbers * @property VoiceList $voice */ class V1 extends Version { protected $_messaging; protected $_phoneNumbers; protected $_voice; /** * Construct the V1 version of Pricing * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->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]'; } } Pricing/V2/CountryInstance.php 0000644 00000006343 15107452324 0012300 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $country * @property string $isoCountry * @property string[] $terminatingPrefixPrices * @property string[] $originatingCallPrices * @property string $priceUnit * @property string $url */ class CountryInstance extends InstanceResource { /** * Initialize the CountryInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $isoCountry The ISO country code of the pricing information to * fetch */ public function __construct(Version $version, array $payload, string $isoCountry = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Pricing/V2/CountryPage.php 0000644 00000002174 15107452324 0011406 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V2; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CountryPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Pricing/V2/VoiceList.php 0000644 00000005370 15107452324 0011050 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Pricing\V2\Voice\CountryList; use Twilio\Rest\Pricing\V2\Voice\NumberList; use Twilio\Version; /** * @property CountryList $countries * @property NumberList $numbers * @method \Twilio\Rest\Pricing\V2\Voice\CountryContext countries(string $isoCountry) * @method \Twilio\Rest\Pricing\V2\Voice\NumberContext numbers(string $destinationNumber) */ class VoiceList extends ListResource { protected $_countries = null; protected $_numbers = null; /** * Construct the VoiceList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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]'; } } Pricing/V2/NumberPage.php 0000644 00000002166 15107452324 0011174 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V2; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class NumberPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Pricing/V2/CountryContext.php 0000644 00000003065 15107452324 0012156 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class CountryContext extends InstanceContext { /** * Initialize the CountryContext * * @param Version $version Version that contains the resource * @param string $isoCountry The ISO country code of the pricing information to * fetch */ public function __construct(Version $version, $isoCountry) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Pricing/V2/CountryList.php 0000644 00000011110 15107452324 0011433 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V2; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class CountryList extends ListResource { /** * Construct the CountryList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Trunking/Countries'; } /** * Streams CountryInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 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.V2.CountryList]'; } } Pricing/V2/VoicePage.php 0000644 00000002160 15107452324 0011003 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V2; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class VoicePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Pricing/V2/NumberOptions.php 0000644 00000003533 15107452324 0011752 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V2; use Twilio\Options; use Twilio\Values; abstract class NumberOptions { /** * @param string $originationNumber The origination number for which to fetch * pricing information * @return FetchNumberOptions Options builder */ public static function fetch(string $originationNumber = Values::NONE): FetchNumberOptions { return new FetchNumberOptions($originationNumber); } } class FetchNumberOptions extends Options { /** * @param string $originationNumber The origination number for which to fetch * pricing information */ public function __construct(string $originationNumber = Values::NONE) { $this->options['originationNumber'] = $originationNumber; } /** * The origination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. * * @param string $originationNumber The origination number for which to fetch * pricing information * @return $this Fluent Builder */ public function setOriginationNumber(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 . ']'; } } Pricing/V2/VoiceInstance.php 0000644 00000003351 15107452324 0011676 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $name * @property string $url * @property array $links */ class VoiceInstance extends InstanceResource { /** * Initialize the VoiceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'name' => Values::array_get($payload, 'name'), '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.Pricing.V2.VoiceInstance]'; } } Pricing/V2/NumberList.php 0000644 00000002071 15107452324 0011226 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V2; use Twilio\ListResource; use Twilio\Version; class NumberList extends ListResource { /** * Construct the NumberList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; } /** * Constructs a NumberContext * * @param string $destinationNumber The destination number for which to fetch * pricing information */ 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]'; } } Pricing/V2/NumberContext.php 0000644 00000003514 15107452324 0011742 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class NumberContext extends InstanceContext { /** * Initialize the NumberContext * * @param Version $version Version that contains the resource * @param string $destinationNumber The destination number for which to fetch * pricing information */ public function __construct(Version $version, $destinationNumber) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->fetch('GET', $this->uri, $params); return new NumberInstance($this->version, $payload, $this->solution['destinationNumber']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Pricing.V2.NumberContext ' . \implode(' ', $context) . ']'; } } Pricing/V2/Voice/CountryInstance.php 0000644 00000006324 15107452324 0013344 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V2\Voice; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $country * @property string $isoCountry * @property string[] $outboundPrefixPrices * @property string[] $inboundCallPrices * @property string $priceUnit * @property string $url */ class CountryInstance extends InstanceResource { /** * Initialize the CountryInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $isoCountry The ISO country code of the pricing information to * fetch */ public function __construct(Version $version, array $payload, string $isoCountry = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Pricing/V2/Voice/CountryPage.php 0000644 00000002210 15107452324 0012442 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V2\Voice; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CountryPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Pricing/V2/Voice/NumberPage.php 0000644 00000002202 15107452324 0012230 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V2\Voice; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class NumberPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Pricing/V2/Voice/CountryContext.php 0000644 00000003070 15107452325 0013220 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V2\Voice; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class CountryContext extends InstanceContext { /** * Initialize the CountryContext * * @param Version $version Version that contains the resource * @param string $isoCountry The ISO country code of the pricing information to * fetch */ public function __construct(Version $version, $isoCountry) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Pricing/V2/Voice/CountryList.php 0000644 00000011113 15107452325 0012504 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V2\Voice; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class CountryList extends ListResource { /** * Construct the CountryList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Voice/Countries'; } /** * Streams CountryInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 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.V2.CountryList]'; } } Pricing/V2/Voice/NumberOptions.php 0000644 00000003541 15107452325 0013017 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V2\Voice; use Twilio\Options; use Twilio\Values; abstract class NumberOptions { /** * @param string $originationNumber The origination number for which to fetch * pricing information * @return FetchNumberOptions Options builder */ public static function fetch(string $originationNumber = Values::NONE): FetchNumberOptions { return new FetchNumberOptions($originationNumber); } } class FetchNumberOptions extends Options { /** * @param string $originationNumber The origination number for which to fetch * pricing information */ public function __construct(string $originationNumber = Values::NONE) { $this->options['originationNumber'] = $originationNumber; } /** * The origination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. * * @param string $originationNumber The origination number for which to fetch * pricing information * @return $this Fluent Builder */ public function setOriginationNumber(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 . ']'; } } Pricing/V2/Voice/NumberList.php 0000644 00000002077 15107452325 0012302 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V2\Voice; use Twilio\ListResource; use Twilio\Version; class NumberList extends ListResource { /** * Construct the NumberList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; } /** * Constructs a NumberContext * * @param string $destinationNumber The destination number for which to fetch * pricing information */ 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]'; } } Pricing/V2/Voice/NumberContext.php 0000644 00000003517 15107452325 0013013 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V2\Voice; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class NumberContext extends InstanceContext { /** * Initialize the NumberContext * * @param Version $version Version that contains the resource * @param string $destinationNumber The destination number for which to fetch * pricing information */ public function __construct(Version $version, $destinationNumber) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->fetch('GET', $this->uri, $params); return new NumberInstance($this->version, $payload, $this->solution['destinationNumber']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Pricing.V2.NumberContext ' . \implode(' ', $context) . ']'; } } Pricing/V2/Voice/NumberInstance.php 0000644 00000007152 15107452325 0013132 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V2\Voice; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $destinationNumber * @property string $originationNumber * @property string $country * @property string $isoCountry * @property string[] $outboundCallPrices * @property string $inboundCallPrice * @property string $priceUnit * @property string $url */ class NumberInstance extends InstanceResource { /** * Initialize the NumberInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $destinationNumber The destination number for which to fetch * pricing information */ public function __construct(Version $version, array $payload, string $destinationNumber = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Pricing/V2/NumberInstance.php 0000644 00000007177 15107452325 0012074 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $destinationNumber * @property string $originationNumber * @property string $country * @property string $isoCountry * @property string[] $terminatingPrefixPrices * @property string $originatingCallPrice * @property string $priceUnit * @property string $url */ class NumberInstance extends InstanceResource { /** * Initialize the NumberInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $destinationNumber The destination number for which to fetch * pricing information */ public function __construct(Version $version, array $payload, string $destinationNumber = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Pricing/V2.php 0000644 00000005451 15107452325 0007150 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Pricing\V2\CountryList; use Twilio\Rest\Pricing\V2\NumberList; use Twilio\Rest\Pricing\V2\VoiceList; use Twilio\Version; /** * @property CountryList $countries * @property NumberList $numbers * @property VoiceList $voice * @method \Twilio\Rest\Pricing\V2\CountryContext countries(string $isoCountry) * @method \Twilio\Rest\Pricing\V2\NumberContext numbers(string $destinationNumber) */ class V2 extends Version { protected $_countries; protected $_numbers; protected $_voice; /** * Construct the V2 version of Pricing * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->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]'; } } Lookups.php 0000644 00000005533 15107452325 0006723 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Lookups\V1; use Twilio\Rest\Lookups\V2; /** * @property \Twilio\Rest\Lookups\V1 $v1 * @property \Twilio\Rest\Lookups\V2 $v2 * @property \Twilio\Rest\Lookups\V1\PhoneNumberList $phoneNumbers * @method \Twilio\Rest\Lookups\V1\PhoneNumberContext phoneNumbers(string $phoneNumber) */ class Lookups extends Domain { protected $_v1; protected $_v2; /** * Construct the Lookups Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->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); } protected function getPhoneNumbers(): \Twilio\Rest\Lookups\V1\PhoneNumberList { return $this->v1->phoneNumbers; } /** * @param string $phoneNumber The phone number to fetch in E.164 format */ protected function contextPhoneNumbers(string $phoneNumber): \Twilio\Rest\Lookups\V1\PhoneNumberContext { return $this->v1->phoneNumbers($phoneNumber); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Lookups]'; } } Proxy/V1/Service/ShortCodeList.php 0000644 00000012627 15107452325 0013026 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ShortCodeList extends ListResource { /** * Construct the ShortCodeList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the resource's parent Service */ public function __construct(Version $version, string $serviceSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/ShortCodes'; } /** * Create the ShortCodeInstance * * @param string $sid The SID of a Twilio ShortCode resource * @return ShortCodeInstance Created ShortCodeInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $sid): ShortCodeInstance { $data = Values::of(['Sid' => $sid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ShortCodeInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams ShortCodeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 unique string that identifies the resource */ 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]'; } } Proxy/V1/Service/SessionInstance.php 0000644 00000013206 15107452325 0013402 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Proxy\V1\Service\Session\InteractionList; use Twilio\Rest\Proxy\V1\Service\Session\ParticipantList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $serviceSid * @property string $accountSid * @property \DateTime $dateStarted * @property \DateTime $dateEnded * @property \DateTime $dateLastInteraction * @property \DateTime $dateExpiry * @property string $uniqueName * @property string $status * @property string $closedReason * @property int $ttl * @property string $mode * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class SessionInstance extends InstanceResource { protected $_interactions; protected $_participants; /** * Initialize the SessionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the resource's parent Service * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the SessionInstance * * @return SessionInstance Fetched SessionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SessionInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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 interactions */ protected function getInteractions(): InteractionList { return $this->proxy()->interactions; } /** * 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.Proxy.V1.SessionInstance ' . \implode(' ', $context) . ']'; } } Proxy/V1/Service/PhoneNumberPage.php 0000644 00000002456 15107452325 0013316 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class PhoneNumberPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Proxy/V1/Service/ShortCodePage.php 0000644 00000002442 15107452325 0012761 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ShortCodePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Proxy/V1/Service/PhoneNumberContext.php 0000644 00000005674 15107452325 0014073 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class PhoneNumberContext extends InstanceContext { /** * Initialize the PhoneNumberContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the parent Service resource of the * PhoneNumber resource to fetch * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->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 { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the PhoneNumberInstance * * @return PhoneNumberInstance Fetched PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PhoneNumberInstance { $payload = $this->version->fetch('GET', $this->uri); 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']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new PhoneNumberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Proxy.V1.PhoneNumberContext ' . \implode(' ', $context) . ']'; } } Proxy/V1/Service/Session/ParticipantList.php 0000644 00000014235 15107452325 0015032 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service\Session; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ParticipantList extends ListResource { /** * Construct the ParticipantList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the resource's parent Service * @param string $sessionSid The SID of the resource's parent Session */ public function __construct(Version $version, string $serviceSid, string $sessionSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'sessionSid' => $sessionSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Sessions/' . \rawurlencode($sessionSid) . '/Participants'; } /** * Streams ParticipantInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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); } /** * 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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ParticipantInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sessionSid'] ); } /** * Constructs a ParticipantContext * * @param string $sid The unique string that identifies the resource */ 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]'; } } Proxy/V1/Service/Session/ParticipantInstance.php 0000644 00000012044 15107452325 0015657 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service\Session; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Rest\Proxy\V1\Service\Session\Participant\MessageInteractionList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $sessionSid * @property string $serviceSid * @property string $accountSid * @property string $friendlyName * @property string $identifier * @property string $proxyIdentifier * @property string $proxyIdentifierSid * @property \DateTime $dateDeleted * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class ParticipantInstance extends InstanceResource { protected $_messageInteractions; /** * Initialize the ParticipantInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the resource's parent Service * @param string $sessionSid The SID of the resource's parent Session * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $serviceSid, string $sessionSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the ParticipantInstance * * @return ParticipantInstance Fetched ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ParticipantInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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) . ']'; } } Proxy/V1/Service/Session/Participant/MessageInteractionContext.php 0000644 00000004637 15107452325 0021334 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service\Session\Participant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class MessageInteractionContext extends InstanceContext { /** * Initialize the MessageInteractionContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $sessionSid The SID of the parent Session * @param string $participantSid The SID of the Participant resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $serviceSid, $sessionSid, $participantSid, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Proxy/V1/Service/Session/Participant/MessageInteractionList.php 0000644 00000015003 15107452325 0020610 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service\Session\Participant; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class MessageInteractionList extends ListResource { /** * Construct the MessageInteractionList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the resource's parent Service * @param string $sessionSid The SID of the resource's parent Session * @param string $participantSid The SID of the Participant resource */ public function __construct(Version $version, string $serviceSid, string $sessionSid, string $participantSid) { parent::__construct($version); // Path Solution $this->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; }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new MessageInteractionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sessionSid'], $this->solution['participantSid'] ); } /** * Streams MessageInteractionInstance records from the API as a generator * stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 unique string that identifies the resource */ 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]'; } } Proxy/V1/Service/Session/Participant/MessageInteractionPage.php 0000644 00000003010 15107452325 0020544 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service\Session\Participant; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class MessageInteractionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Proxy/V1/Service/Session/Participant/MessageInteractionOptions.php 0000644 00000003661 15107452325 0021337 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service\Session\Participant; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ abstract class MessageInteractionOptions { /** * @param string $body Message body * @param string[] $mediaUrl Reserved * @return CreateMessageInteractionOptions Options builder */ public static function create(string $body = Values::NONE, array $mediaUrl = Values::ARRAY_NONE): CreateMessageInteractionOptions { return new CreateMessageInteractionOptions($body, $mediaUrl); } } class CreateMessageInteractionOptions extends Options { /** * @param string $body Message body * @param string[] $mediaUrl Reserved */ public function __construct(string $body = Values::NONE, array $mediaUrl = Values::ARRAY_NONE) { $this->options['body'] = $body; $this->options['mediaUrl'] = $mediaUrl; } /** * The message to send to the participant * * @param string $body Message body * @return $this Fluent Builder */ public function setBody(string $body): self { $this->options['body'] = $body; return $this; } /** * Reserved. Not currently supported. * * @param string[] $mediaUrl Reserved * @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 . ']'; } } Proxy/V1/Service/Session/Participant/MessageInteractionInstance.php 0000644 00000013303 15107452325 0021442 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service\Session\Participant; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $sessionSid * @property string $serviceSid * @property string $accountSid * @property string $data * @property string $type * @property string $participantSid * @property string $inboundParticipantSid * @property string $inboundResourceSid * @property string $inboundResourceStatus * @property string $inboundResourceType * @property string $inboundResourceUrl * @property string $outboundParticipantSid * @property string $outboundResourceSid * @property string $outboundResourceStatus * @property string $outboundResourceType * @property string $outboundResourceUrl * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class MessageInteractionInstance extends InstanceResource { /** * Initialize the MessageInteractionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the resource's parent Service * @param string $sessionSid The SID of the resource's parent Session * @param string $participantSid The SID of the Participant resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $serviceSid, string $sessionSid, string $participantSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Proxy/V1/Service/Session/InteractionInstance.php 0000644 00000013072 15107452325 0015662 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service\Session; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $sessionSid * @property string $serviceSid * @property string $accountSid * @property string $data * @property string $type * @property string $inboundParticipantSid * @property string $inboundResourceSid * @property string $inboundResourceStatus * @property string $inboundResourceType * @property string $inboundResourceUrl * @property string $outboundParticipantSid * @property string $outboundResourceSid * @property string $outboundResourceStatus * @property string $outboundResourceType * @property string $outboundResourceUrl * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class InteractionInstance extends InstanceResource { /** * Initialize the InteractionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the resource's parent Service * @param string $sessionSid The SID of the resource's parent Session * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $serviceSid, string $sessionSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the InteractionInstance * * @return InteractionInstance Fetched InteractionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): InteractionInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Proxy/V1/Service/Session/ParticipantContext.php 0000644 00000010477 15107452325 0015547 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service\Session; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Proxy\V1\Service\Session\Participant\MessageInteractionList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property MessageInteractionList $messageInteractions * @method \Twilio\Rest\Proxy\V1\Service\Session\Participant\MessageInteractionContext messageInteractions(string $sid) */ class ParticipantContext extends InstanceContext { protected $_messageInteractions; /** * Initialize the ParticipantContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the parent Service of the resource to * fetch * @param string $sessionSid The SID of the parent Session of the resource to * fetch * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $serviceSid, $sessionSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'sessionSid' => $sessionSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Sessions/' . \rawurlencode($sessionSid) . '/Participants/' . \rawurlencode($sid) . ''; } /** * Fetch the ParticipantInstance * * @return ParticipantInstance Fetched ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ParticipantInstance { $payload = $this->version->fetch('GET', $this->uri); return new ParticipantInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sessionSid'], $this->solution['sid'] ); } /** * Delete the ParticipantInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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) . ']'; } } Proxy/V1/Service/Session/ParticipantOptions.php 0000644 00000006515 15107452325 0015554 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service\Session; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ abstract class ParticipantOptions { /** * @param string $friendlyName The string that you assigned to describe the * participant * @param string $proxyIdentifier The proxy phone number to use for the * Participant * @param string $proxyIdentifierSid The Proxy Identifier Sid * @return CreateParticipantOptions Options builder */ public static function create(string $friendlyName = Values::NONE, string $proxyIdentifier = Values::NONE, string $proxyIdentifierSid = Values::NONE): CreateParticipantOptions { return new CreateParticipantOptions($friendlyName, $proxyIdentifier, $proxyIdentifierSid); } } class CreateParticipantOptions extends Options { /** * @param string $friendlyName The string that you assigned to describe the * participant * @param string $proxyIdentifier The proxy phone number to use for the * Participant * @param string $proxyIdentifierSid The Proxy Identifier Sid */ public function __construct(string $friendlyName = Values::NONE, string $proxyIdentifier = Values::NONE, string $proxyIdentifierSid = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['proxyIdentifier'] = $proxyIdentifier; $this->options['proxyIdentifierSid'] = $proxyIdentifierSid; } /** * The string that you assigned to describe the participant. This value must be 255 characters or fewer. **This value should not have PII.** * * @param string $friendlyName The string that you assigned to describe the * participant * @return $this Fluent Builder */ public function setFriendlyName(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 * @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 Proxy Identifier Sid * @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 . ']'; } } Proxy/V1/Service/Session/InteractionContext.php 0000644 00000004665 15107452325 0015552 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service\Session; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class InteractionContext extends InstanceContext { /** * Initialize the InteractionContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the parent Service of the resource to * fetch * @param string $sessionSid he SID of the parent Session of the resource to * fetch * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $serviceSid, $sessionSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'sessionSid' => $sessionSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Sessions/' . \rawurlencode($sessionSid) . '/Interactions/' . \rawurlencode($sid) . ''; } /** * Fetch the InteractionInstance * * @return InteractionInstance Fetched InteractionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): InteractionInstance { $payload = $this->version->fetch('GET', $this->uri); return new InteractionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sessionSid'], $this->solution['sid'] ); } /** * Delete the InteractionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Proxy/V1/Service/Session/ParticipantPage.php 0000644 00000002627 15107452325 0014775 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service\Session; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ParticipantPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Proxy/V1/Service/Session/InteractionList.php 0000644 00000012221 15107452325 0015024 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service\Session; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class InteractionList extends ListResource { /** * Construct the InteractionList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the resource's parent Service * @param string $sessionSid The SID of the resource's parent Session */ public function __construct(Version $version, string $serviceSid, string $sessionSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'sessionSid' => $sessionSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Sessions/' . \rawurlencode($sessionSid) . '/Interactions'; } /** * Streams InteractionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 unique string that identifies the resource */ 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]'; } } Proxy/V1/Service/Session/InteractionPage.php 0000644 00000002627 15107452325 0014776 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service\Session; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class InteractionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Proxy/V1/Service/ShortCodeContext.php 0000644 00000005613 15107452325 0013534 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ShortCodeContext extends InstanceContext { /** * Initialize the ShortCodeContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the parent Service to fetch the * resource from * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->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 { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the ShortCodeInstance * * @return ShortCodeInstance Fetched ShortCodeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ShortCodeInstance { $payload = $this->version->fetch('GET', $this->uri); 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']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ShortCodeInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Proxy.V1.ShortCodeContext ' . \implode(' ', $context) . ']'; } } Proxy/V1/Service/PhoneNumberList.php 0000644 00000013370 15107452325 0013352 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class PhoneNumberList extends ListResource { /** * Construct the PhoneNumberList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the PhoneNumber resource's parent * Service resource */ public function __construct(Version $version, string $serviceSid) { parent::__construct($version); // Path Solution $this->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']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new PhoneNumberInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams PhoneNumberInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 identifies the resource */ 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]'; } } Proxy/V1/Service/SessionPage.php 0000644 00000002426 15107452325 0012514 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SessionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Proxy/V1/Service/SessionContext.php 0000644 00000012370 15107452325 0013263 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Proxy\V1\Service\Session\InteractionList; use Twilio\Rest\Proxy\V1\Service\Session\ParticipantList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property InteractionList $interactions * @property ParticipantList $participants * @method \Twilio\Rest\Proxy\V1\Service\Session\InteractionContext interactions(string $sid) * @method \Twilio\Rest\Proxy\V1\Service\Session\ParticipantContext participants(string $sid) */ class SessionContext extends InstanceContext { protected $_interactions; protected $_participants; /** * Initialize the SessionContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Sessions/' . \rawurlencode($sid) . ''; } /** * Fetch the SessionInstance * * @return SessionInstance Fetched SessionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SessionInstance { $payload = $this->version->fetch('GET', $this->uri); return new SessionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Delete the SessionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the SessionInstance * * @param array|Options $options Optional Arguments * @return SessionInstance Updated SessionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SessionInstance { $options = new Values($options); $data = Values::of([ 'DateExpiry' => Serialize::iso8601DateTime($options['dateExpiry']), 'Ttl' => $options['ttl'], 'Status' => $options['status'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SessionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * 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; } /** * 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; } /** * 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) . ']'; } } Proxy/V1/Service/SessionList.php 0000644 00000013454 15107452325 0012556 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SessionList extends ListResource { /** * Construct the SessionList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the resource's parent Service */ public function __construct(Version $version, string $serviceSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Sessions'; } /** * Streams SessionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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); } /** * 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); }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SessionInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Constructs a SessionContext * * @param string $sid The unique string that identifies the resource */ 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]'; } } Proxy/V1/Service/ShortCodeOptions.php 0000644 00000003625 15107452325 0013544 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ abstract class ShortCodeOptions { /** * @param bool $isReserved Whether the short code should be reserved for manual * assignment to participants only * @return UpdateShortCodeOptions Options builder */ public static function update(bool $isReserved = Values::NONE): UpdateShortCodeOptions { return new UpdateShortCodeOptions($isReserved); } } class UpdateShortCodeOptions extends Options { /** * @param bool $isReserved Whether the short code should be reserved for manual * assignment to participants only */ public function __construct(bool $isReserved = Values::NONE) { $this->options['isReserved'] = $isReserved; } /** * Whether the short code should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information. * * @param bool $isReserved Whether the short code should be reserved for manual * assignment to participants only * @return $this Fluent Builder */ public function setIsReserved(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 . ']'; } } Proxy/V1/Service/SessionOptions.php 0000644 00000016737 15107452325 0013305 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ abstract class SessionOptions { /** * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param \DateTime $dateExpiry The ISO 8601 date when the Session should expire * @param int $ttl When the session will expire * @param string $mode The Mode of the Session * @param string $status Session status * @param array[] $participants The Participant objects to include in the new * session * @return CreateSessionOptions Options builder */ public static function create(string $uniqueName = Values::NONE, \DateTime $dateExpiry = Values::NONE, int $ttl = Values::NONE, string $mode = Values::NONE, string $status = Values::NONE, array $participants = Values::ARRAY_NONE): CreateSessionOptions { return new CreateSessionOptions($uniqueName, $dateExpiry, $ttl, $mode, $status, $participants); } /** * @param \DateTime $dateExpiry The ISO 8601 date when the Session should expire * @param int $ttl When the session will expire * @param string $status The new status of the resource * @return UpdateSessionOptions Options builder */ public static function update(\DateTime $dateExpiry = Values::NONE, int $ttl = Values::NONE, string $status = Values::NONE): UpdateSessionOptions { return new UpdateSessionOptions($dateExpiry, $ttl, $status); } } class CreateSessionOptions extends Options { /** * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param \DateTime $dateExpiry The ISO 8601 date when the Session should expire * @param int $ttl When the session will expire * @param string $mode The Mode of the Session * @param string $status Session status * @param array[] $participants The Participant objects to include in the new * session */ public function __construct(string $uniqueName = Values::NONE, \DateTime $dateExpiry = Values::NONE, int $ttl = Values::NONE, string $mode = Values::NONE, string $status = Values::NONE, array $participants = Values::ARRAY_NONE) { $this->options['uniqueName'] = $uniqueName; $this->options['dateExpiry'] = $dateExpiry; $this->options['ttl'] = $ttl; $this->options['mode'] = $mode; $this->options['status'] = $status; $this->options['participants'] = $participants; } /** * An application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. **This value should not have PII.** * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return $this Fluent Builder */ public function setUniqueName(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 date when the Session should expire * @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 When the session will expire * @return $this Fluent Builder */ public function setTtl(int $ttl): self { $this->options['ttl'] = $ttl; return $this; } /** * The Mode of the Session. Can be: `message-only`, `voice-only`, or `voice-and-message` and the default value is `voice-and-message`. * * @param string $mode The Mode of the Session * @return $this Fluent Builder */ public function setMode(string $mode): self { $this->options['mode'] = $mode; return $this; } /** * The initial status of the Session. Can be: `open`, `in-progress`, `closed`, `failed`, or `unknown`. The default is `open` on create. * * @param string $status Session status * @return $this Fluent Builder */ public function setStatus(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 date when the Session should expire * @param int $ttl When the session will expire * @param string $status The new status of the resource */ public function __construct(\DateTime $dateExpiry = Values::NONE, int $ttl = Values::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 date when the Session should expire * @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 When the session will expire * @return $this Fluent Builder */ public function setTtl(int $ttl): self { $this->options['ttl'] = $ttl; return $this; } /** * The new status of the resource. Can be: `in-progress` to re-open a session or `closed` to close a session. * * @param string $status The new status of the resource * @return $this Fluent Builder */ public function setStatus(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 . ']'; } } Proxy/V1/Service/PhoneNumberInstance.php 0000644 00000011447 15107452325 0014206 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $phoneNumber * @property string $friendlyName * @property string $isoCountry * @property string $capabilities * @property string $url * @property bool $isReserved * @property int $inUse */ class PhoneNumberInstance extends InstanceResource { /** * Initialize the PhoneNumberInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the PhoneNumber resource's parent * Service resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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' => 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) . ']'; } } Proxy/V1/Service/PhoneNumberOptions.php 0000644 00000011062 15107452325 0014066 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ abstract class PhoneNumberOptions { /** * @param string $sid The SID of a Twilio IncomingPhoneNumber resource * @param string $phoneNumber The phone number in E.164 format * @param bool $isReserved Whether the new phone number should be reserved * @return CreatePhoneNumberOptions Options builder */ public static function create(string $sid = Values::NONE, string $phoneNumber = Values::NONE, bool $isReserved = Values::NONE): CreatePhoneNumberOptions { return new CreatePhoneNumberOptions($sid, $phoneNumber, $isReserved); } /** * @param bool $isReserved Whether the new phone number should be reserved * @return UpdatePhoneNumberOptions Options builder */ public static function update(bool $isReserved = Values::NONE): UpdatePhoneNumberOptions { return new UpdatePhoneNumberOptions($isReserved); } } class CreatePhoneNumberOptions extends Options { /** * @param string $sid The SID of a Twilio IncomingPhoneNumber resource * @param string $phoneNumber The phone number in E.164 format * @param bool $isReserved Whether the new phone number should be reserved */ public function __construct(string $sid = Values::NONE, string $phoneNumber = Values::NONE, bool $isReserved = Values::NONE) { $this->options['sid'] = $sid; $this->options['phoneNumber'] = $phoneNumber; $this->options['isReserved'] = $isReserved; } /** * The SID of a Twilio [IncomingPhoneNumber](https://www.twilio.com/docs/phone-numbers/api/incomingphonenumber-resource) resource that represents the Twilio Number you would like to assign to your Proxy Service. * * @param string $sid The SID of a Twilio IncomingPhoneNumber resource * @return $this Fluent Builder */ public function setSid(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 format * @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 * @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 new phone number should be reserved */ public function __construct(bool $isReserved = Values::NONE) { $this->options['isReserved'] = $isReserved; } /** * Whether the phone number should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information. * * @param bool $isReserved Whether the new phone number should be reserved * @return $this Fluent Builder */ public function setIsReserved(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 . ']'; } } Proxy/V1/Service/ShortCodeInstance.php 0000644 00000011007 15107452325 0013646 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $shortCode * @property string $isoCountry * @property string $capabilities * @property string $url * @property bool $isReserved */ class ShortCodeInstance extends InstanceResource { /** * Initialize the ShortCodeInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the resource's parent Service * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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' => 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) . ']'; } } Proxy/V1/ServiceInstance.php 0000644 00000012713 15107452325 0011761 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Proxy\V1\Service\PhoneNumberList; use Twilio\Rest\Proxy\V1\Service\SessionList; use Twilio\Rest\Proxy\V1\Service\ShortCodeList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $uniqueName * @property string $accountSid * @property string $chatInstanceSid * @property string $callbackUrl * @property int $defaultTtl * @property string $numberSelectionBehavior * @property string $geoMatchLevel * @property string $interceptCallbackUrl * @property string $outOfSessionCallbackUrl * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class ServiceInstance extends InstanceResource { protected $_sessions; protected $_phoneNumbers; protected $_shortCodes; /** * Initialize the ServiceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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 sessions */ protected function getSessions(): SessionList { return $this->proxy()->sessions; } /** * Access the phoneNumbers */ protected function getPhoneNumbers(): PhoneNumberList { return $this->proxy()->phoneNumbers; } /** * Access the shortCodes */ protected function getShortCodes(): ShortCodeList { return $this->proxy()->shortCodes; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Proxy/V1/ServiceList.php 0000644 00000013470 15107452325 0011131 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ServiceList extends ListResource { /** * Construct the ServiceList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Services'; } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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); } /** * Create the ServiceInstance * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ServiceInstance($this->version, $payload); } /** * Constructs a ServiceContext * * @param string $sid The unique string that identifies the 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.Proxy.V1.ServiceList]'; } } Proxy/V1/ServiceContext.php 0000644 00000012647 15107452325 0011647 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Proxy\V1\Service\PhoneNumberList; use Twilio\Rest\Proxy\V1\Service\SessionList; use Twilio\Rest\Proxy\V1\Service\ShortCodeList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property SessionList $sessions * @property PhoneNumberList $phoneNumbers * @property ShortCodeList $shortCodes * @method \Twilio\Rest\Proxy\V1\Service\SessionContext sessions(string $sid) * @method \Twilio\Rest\Proxy\V1\Service\PhoneNumberContext phoneNumbers(string $sid) * @method \Twilio\Rest\Proxy\V1\Service\ShortCodeContext shortCodes(string $sid) */ class ServiceContext extends InstanceContext { protected $_sessions; protected $_phoneNumbers; protected $_shortCodes; /** * Initialize the ServiceContext * * @param Version $version Version that contains the resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($sid) . ''; } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { $payload = $this->version->fetch('GET', $this->uri); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Access the sessions */ protected function getSessions(): SessionList { if (!$this->_sessions) { $this->_sessions = new SessionList($this->version, $this->solution['sid']); } return $this->_sessions; } /** * 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; } /** * 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) . ']'; } } Proxy/V1/ServiceOptions.php 0000644 00000042050 15107452325 0011645 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ abstract class ServiceOptions { /** * @param int $defaultTtl Default TTL for a Session, in seconds * @param string $callbackUrl The URL we should call when the interaction * status changes * @param string $geoMatchLevel Where a proxy number must be located relative * to the participant identifier * @param string $numberSelectionBehavior The preference for Proxy Number * selection for the Service instance * @param string $interceptCallbackUrl The URL we call on each interaction * @param string $outOfSessionCallbackUrl The URL we call when an inbound call * or SMS action occurs on a closed or * non-existent Session * @param string $chatInstanceSid The SID of the Chat Service Instance * @return CreateServiceOptions Options builder */ public static function create(int $defaultTtl = Values::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): CreateServiceOptions { return new CreateServiceOptions($defaultTtl, $callbackUrl, $geoMatchLevel, $numberSelectionBehavior, $interceptCallbackUrl, $outOfSessionCallbackUrl, $chatInstanceSid); } /** * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param int $defaultTtl Default TTL for a Session, in seconds * @param string $callbackUrl The URL we should call when the interaction * status changes * @param string $geoMatchLevel Where a proxy number must be located relative * to the participant identifier * @param string $numberSelectionBehavior The preference for Proxy Number * selection for the Service instance * @param string $interceptCallbackUrl The URL we call on each interaction * @param string $outOfSessionCallbackUrl The URL we call when an inbound call * or SMS action occurs on a closed or * non-existent Session * @param string $chatInstanceSid The SID of the Chat Service Instance * @return UpdateServiceOptions Options builder */ public static function update(string $uniqueName = Values::NONE, int $defaultTtl = Values::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): UpdateServiceOptions { return new UpdateServiceOptions($uniqueName, $defaultTtl, $callbackUrl, $geoMatchLevel, $numberSelectionBehavior, $interceptCallbackUrl, $outOfSessionCallbackUrl, $chatInstanceSid); } } class CreateServiceOptions extends Options { /** * @param int $defaultTtl Default TTL for a Session, in seconds * @param string $callbackUrl The URL we should call when the interaction * status changes * @param string $geoMatchLevel Where a proxy number must be located relative * to the participant identifier * @param string $numberSelectionBehavior The preference for Proxy Number * selection for the Service instance * @param string $interceptCallbackUrl The URL we call on each interaction * @param string $outOfSessionCallbackUrl The URL we call when an inbound call * or SMS action occurs on a closed or * non-existent Session * @param string $chatInstanceSid The SID of the Chat Service Instance */ public function __construct(int $defaultTtl = Values::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['defaultTtl'] = $defaultTtl; $this->options['callbackUrl'] = $callbackUrl; $this->options['geoMatchLevel'] = $geoMatchLevel; $this->options['numberSelectionBehavior'] = $numberSelectionBehavior; $this->options['interceptCallbackUrl'] = $interceptCallbackUrl; $this->options['outOfSessionCallbackUrl'] = $outOfSessionCallbackUrl; $this->options['chatInstanceSid'] = $chatInstanceSid; } /** * The default `ttl` value to set for Sessions created in the Service. The TTL (time to live) is measured in seconds after the Session's last create or last Interaction. The default value of `0` indicates an unlimited Session length. You can override a Session's default TTL value by setting its `ttl` value. * * @param int $defaultTtl Default TTL for a Session, in seconds * @return $this Fluent Builder */ public function setDefaultTtl(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; } /** * Where a proxy number must be located relative to the participant identifier. Can be: `country`, `area-code`, or `extended-area-code`. The default value is `country` and more specific areas than `country` are only available in North America. * * @param string $geoMatchLevel Where a proxy number must be located relative * to the participant identifier * @return $this Fluent Builder */ public function setGeoMatchLevel(string $geoMatchLevel): self { $this->options['geoMatchLevel'] = $geoMatchLevel; return $this; } /** * The preference for Proxy Number selection in the Service instance. Can be: `prefer-sticky` or `avoid-sticky` and the default is `prefer-sticky`. `prefer-sticky` means that we will try and select the same Proxy Number for a given participant if they have previous [Sessions](https://www.twilio.com/docs/proxy/api/session), but we will not fail if that Proxy Number cannot be used. `avoid-sticky` means that we will try to use different Proxy Numbers as long as that is possible within a given pool rather than try and use a previously assigned number. * * @param string $numberSelectionBehavior The preference for Proxy Number * selection for the Service instance * @return $this Fluent Builder */ public function setNumberSelectionBehavior(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 * @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/functions)) responds with valid [TwiML](https://www.twilio.com/docs/voice/twiml), we will process it. This means it is possible, for example, to play a message for a call, send an automated text message response, or redirect a call to another Phone Number. See [Out-of-Session Callback Response Guide](https://www.twilio.com/docs/proxy/out-session-callback-response-guide) for more information. * * @param string $outOfSessionCallbackUrl The URL we call when an inbound call * or SMS action occurs on a closed or * non-existent Session * @return $this Fluent Builder */ public function setOutOfSessionCallbackUrl(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 * @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 * @param int $defaultTtl Default TTL for a Session, in seconds * @param string $callbackUrl The URL we should call when the interaction * status changes * @param string $geoMatchLevel Where a proxy number must be located relative * to the participant identifier * @param string $numberSelectionBehavior The preference for Proxy Number * selection for the Service instance * @param string $interceptCallbackUrl The URL we call on each interaction * @param string $outOfSessionCallbackUrl The URL we call when an inbound call * or SMS action occurs on a closed or * non-existent Session * @param string $chatInstanceSid The SID of the Chat Service Instance */ public function __construct(string $uniqueName = Values::NONE, int $defaultTtl = Values::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 * @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 Default TTL for a Session, in seconds * @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; } /** * Where a proxy number must be located relative to the participant identifier. Can be: `country`, `area-code`, or `extended-area-code`. The default value is `country` and more specific areas than `country` are only available in North America. * * @param string $geoMatchLevel Where a proxy number must be located relative * to the participant identifier * @return $this Fluent Builder */ public function setGeoMatchLevel(string $geoMatchLevel): self { $this->options['geoMatchLevel'] = $geoMatchLevel; return $this; } /** * The preference for Proxy Number selection in the Service instance. Can be: `prefer-sticky` or `avoid-sticky` and the default is `prefer-sticky`. `prefer-sticky` means that we will try and select the same Proxy Number for a given participant if they have previous [Sessions](https://www.twilio.com/docs/proxy/api/session), but we will not fail if that Proxy Number cannot be used. `avoid-sticky` means that we will try to use different Proxy Numbers as long as that is possible within a given pool rather than try and use a previously assigned number. * * @param string $numberSelectionBehavior The preference for Proxy Number * selection for the Service instance * @return $this Fluent Builder */ public function setNumberSelectionBehavior(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 * @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/functions)) responds with valid [TwiML](https://www.twilio.com/docs/voice/twiml), we will process it. This means it is possible, for example, to play a message for a call, send an automated text message response, or redirect a call to another Phone Number. See [Out-of-Session Callback Response Guide](https://www.twilio.com/docs/proxy/out-session-callback-response-guide) for more information. * * @param string $outOfSessionCallbackUrl The URL we call when an inbound call * or SMS action occurs on a closed or * non-existent Session * @return $this Fluent Builder */ public function setOutOfSessionCallbackUrl(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 * @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 . ']'; } } Proxy/V1/ServicePage.php 0000644 00000002347 15107452325 0011073 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ServicePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Proxy/V1.php 0000644 00000004233 15107452325 0006672 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Proxy\V1\ServiceList; use Twilio\Version; /** * @property ServiceList $services * @method \Twilio\Rest\Proxy\V1\ServiceContext services(string $sid) */ class V1 extends Version { protected $_services; /** * Construct the V1 version of Proxy * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->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]'; } } Insights.php 0000644 00000007717 15107452325 0007065 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Insights\V1; /** * @property \Twilio\Rest\Insights\V1 $v1 * @property \Twilio\Rest\Insights\V1\SettingList $settings * @property \Twilio\Rest\Insights\V1\CallList $calls * @property \Twilio\Rest\Insights\V1\CallSummariesList $callSummaries * @property \Twilio\Rest\Insights\V1\ConferenceList $conferences * @property \Twilio\Rest\Insights\V1\RoomList $rooms * @method \Twilio\Rest\Insights\V1\SettingContext settings() * @method \Twilio\Rest\Insights\V1\CallContext calls(string $sid) * @method \Twilio\Rest\Insights\V1\ConferenceContext conferences(string $conferenceSid) * @method \Twilio\Rest\Insights\V1\RoomContext rooms(string $roomSid) */ class Insights extends Domain { protected $_v1; /** * Construct the Insights Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->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); } protected function getSettings(): \Twilio\Rest\Insights\V1\SettingList { return $this->v1->settings; } protected function contextSettings(): \Twilio\Rest\Insights\V1\SettingContext { return $this->v1->settings(); } protected function getCalls(): \Twilio\Rest\Insights\V1\CallList { return $this->v1->calls; } /** * @param string $sid The sid */ protected function contextCalls(string $sid): \Twilio\Rest\Insights\V1\CallContext { return $this->v1->calls($sid); } protected function getCallSummaries(): \Twilio\Rest\Insights\V1\CallSummariesList { return $this->v1->callSummaries; } protected function getConferences(): \Twilio\Rest\Insights\V1\ConferenceList { return $this->v1->conferences; } /** * @param string $conferenceSid Conference SID. */ protected function contextConferences(string $conferenceSid): \Twilio\Rest\Insights\V1\ConferenceContext { return $this->v1->conferences($conferenceSid); } protected function getRooms(): \Twilio\Rest\Insights\V1\RoomList { return $this->v1->rooms; } /** * @param string $roomSid The SID of the Room resource. */ protected function contextRooms(string $roomSid): \Twilio\Rest\Insights\V1\RoomContext { return $this->v1->rooms($roomSid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Insights]'; } } Bulkexports/V1/ExportConfigurationList.php 0000644 00000002212 15107452325 0014733 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Bulkexports\V1; use Twilio\ListResource; use Twilio\Version; class ExportConfigurationList extends ListResource { /** * Construct the ExportConfigurationList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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]'; } } Bulkexports/V1/ExportConfigurationContext.php 0000644 00000005012 15107452325 0015445 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Bulkexports\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class ExportConfigurationContext extends InstanceContext { /** * Initialize the ExportConfigurationContext * * @param Version $version Version that contains the resource * @param string $resourceType The type of communication – Messages, Calls, * Conferences, and Participants */ public function __construct(Version $version, $resourceType) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } Bulkexports/V1/ExportPage.php 0000644 00000002202 15107452325 0012143 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Bulkexports\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ExportPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Bulkexports/V1/ExportConfigurationInstance.php 0000644 00000007266 15107452325 0015602 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Bulkexports\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property bool $enabled * @property string $webhookUrl * @property string $webhookMethod * @property string $resourceType * @property string $url */ class ExportConfigurationInstance extends InstanceResource { /** * Initialize the ExportConfigurationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $resourceType The type of communication – Messages, Calls, * Conferences, and Participants */ public function __construct(Version $version, array $payload, string $resourceType = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Bulkexports/V1/ExportInstance.php 0000644 00000006517 15107452325 0013050 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Bulkexports\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Rest\Bulkexports\V1\Export\DayList; use Twilio\Rest\Bulkexports\V1\Export\ExportCustomJobList; use Twilio\Values; use Twilio\Version; /** * @property string $resourceType * @property string $url * @property array $links */ class ExportInstance extends InstanceResource { protected $_days; protected $_exportCustomJobs; /** * Initialize the ExportInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $resourceType The type of communication – Messages, Calls, * Conferences, and Participants */ public function __construct(Version $version, array $payload, string $resourceType = null) { parent::__construct($version); // Marshaled Properties $this->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 days */ protected function getDays(): DayList { return $this->proxy()->days; } /** * Access the exportCustomJobs */ protected function getExportCustomJobs(): ExportCustomJobList { return $this->proxy()->exportCustomJobs; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Bulkexports/V1/ExportConfigurationOptions.php 0000644 00000005442 15107452325 0015463 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Bulkexports\V1; use Twilio\Options; use Twilio\Values; abstract class ExportConfigurationOptions { /** * @param bool $enabled Whether files are automatically generated * @param string $webhookUrl URL targeted at export * @param string $webhookMethod Whether to GET or POST to the webhook url * @return UpdateExportConfigurationOptions Options builder */ public static function update(bool $enabled = Values::NONE, string $webhookUrl = Values::NONE, string $webhookMethod = Values::NONE): UpdateExportConfigurationOptions { return new UpdateExportConfigurationOptions($enabled, $webhookUrl, $webhookMethod); } } class UpdateExportConfigurationOptions extends Options { /** * @param bool $enabled Whether files are automatically generated * @param string $webhookUrl URL targeted at export * @param string $webhookMethod Whether to GET or POST to the webhook url */ public function __construct(bool $enabled = Values::NONE, string $webhookUrl = Values::NONE, string $webhookMethod = Values::NONE) { $this->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 Whether files are automatically generated * @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 URL targeted at export * @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 Whether to GET or POST to 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 . ']'; } } Bulkexports/V1/ExportList.php 0000644 00000005163 15107452326 0012214 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Bulkexports\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Bulkexports\V1\Export\JobList; use Twilio\Version; /** * @property JobList $jobs * @method \Twilio\Rest\Bulkexports\V1\Export\JobContext jobs(string $jobSid) */ class ExportList extends ListResource { protected $_jobs = null; /** * Construct the ExportList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; } /** * Access the jobs */ protected function getJobs(): JobList { if (!$this->_jobs) { $this->_jobs = new JobList($this->version); } return $this->_jobs; } /** * 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); } /** * 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]'; } } Bulkexports/V1/ExportContext.php 0000644 00000007122 15107452326 0012722 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Bulkexports\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Bulkexports\V1\Export\DayList; use Twilio\Rest\Bulkexports\V1\Export\ExportCustomJobList; use Twilio\Values; use Twilio\Version; /** * @property DayList $days * @property ExportCustomJobList $exportCustomJobs * @method \Twilio\Rest\Bulkexports\V1\Export\DayContext days(string $day) */ class ExportContext extends InstanceContext { protected $_days; protected $_exportCustomJobs; /** * Initialize the ExportContext * * @param Version $version Version that contains the resource * @param string $resourceType The type of communication – Messages, Calls, * Conferences, and Participants */ public function __construct(Version $version, $resourceType) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); return new ExportInstance($this->version, $payload, $this->solution['resourceType']); } /** * Access the days */ protected function getDays(): DayList { if (!$this->_days) { $this->_days = new DayList($this->version, $this->solution['resourceType']); } return $this->_days; } /** * Access the exportCustomJobs */ protected function getExportCustomJobs(): ExportCustomJobList { if (!$this->_exportCustomJobs) { $this->_exportCustomJobs = new ExportCustomJobList($this->version, $this->solution['resourceType']); } return $this->_exportCustomJobs; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return 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) . ']'; } } Bulkexports/V1/Export/JobPage.php 0000644 00000002176 15107452326 0012670 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Bulkexports\V1\Export; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class JobPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Bulkexports/V1/Export/JobContext.php 0000644 00000003445 15107452326 0013440 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Bulkexports\V1\Export; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class JobContext extends InstanceContext { /** * Initialize the JobContext * * @param Version $version Version that contains the resource * @param string $jobSid The unique string that that we created to identify the * Bulk Export job */ public function __construct(Version $version, $jobSid) { parent::__construct($version); // Path Solution $this->solution = ['jobSid' => $jobSid, ]; $this->uri = '/Exports/Jobs/' . \rawurlencode($jobSid) . ''; } /** * Fetch the JobInstance * * @return JobInstance Fetched JobInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): JobInstance { $payload = $this->version->fetch('GET', $this->uri); return new JobInstance($this->version, $payload, $this->solution['jobSid']); } /** * Delete the JobInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Bulkexports/V1/Export/DayPage.php 0000644 00000002237 15107452326 0012671 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Bulkexports\V1\Export; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class DayPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Bulkexports/V1/Export/ExportCustomJobPage.php 0000644 00000002347 15107452326 0015265 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Bulkexports\V1\Export; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ExportCustomJobPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Bulkexports/V1/Export/JobInstance.php 0000644 00000007777 15107452326 0013574 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Bulkexports\V1\Export; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $resourceType * @property string $friendlyName * @property array $details * @property string $startDay * @property string $endDay * @property string $jobSid * @property string $webhookUrl * @property string $webhookMethod * @property string $email * @property string $url * @property string $jobQueuePosition * @property string $estimatedCompletionTime */ class JobInstance extends InstanceResource { /** * Initialize the JobInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $jobSid The unique string that that we created to identify the * Bulk Export job */ public function __construct(Version $version, array $payload, string $jobSid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the JobInstance * * @return JobInstance Fetched JobInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): JobInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Bulkexports/V1/Export/JobList.php 0000644 00000002023 15107452326 0012716 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Bulkexports\V1\Export; use Twilio\ListResource; use Twilio\Version; class JobList extends ListResource { /** * Construct the JobList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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]'; } } Bulkexports/V1/Export/ExportCustomJobOptions.php 0000644 00000010057 15107452326 0016041 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Bulkexports\V1\Export; use Twilio\Options; use Twilio\Values; abstract class ExportCustomJobOptions { /** * @param string $webhookUrl The optional webhook url called on completion of * the job. If this is supplied, `WebhookMethod` 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. * @param string $email The optional email to send the completion notification * to * @return CreateExportCustomJobOptions Options builder */ public static function create(string $webhookUrl = Values::NONE, string $webhookMethod = Values::NONE, string $email = Values::NONE): CreateExportCustomJobOptions { return new CreateExportCustomJobOptions($webhookUrl, $webhookMethod, $email); } } class CreateExportCustomJobOptions extends Options { /** * @param string $webhookUrl The optional webhook url called on completion of * the job. If this is supplied, `WebhookMethod` 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. * @param string $email The optional email to send the completion notification * to */ public function __construct(string $webhookUrl = Values::NONE, string $webhookMethod = Values::NONE, string $email = Values::NONE) { $this->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. * @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 * @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 . ']'; } } Bulkexports/V1/Export/ExportCustomJobList.php 0000644 00000014113 15107452326 0015316 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Bulkexports\V1\Export; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ExportCustomJobList extends ListResource { /** * Construct the ExportCustomJobList * * @param Version $version Version that contains the resource * @param string $resourceType The type of communication – Messages, Calls, * Conferences, and Participants */ public function __construct(Version $version, string $resourceType) { parent::__construct($version); // Path Solution $this->solution = ['resourceType' => $resourceType, ]; $this->uri = '/Exports/' . \rawurlencode($resourceType) . '/Jobs'; } /** * Streams ExportCustomJobInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will 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']); } /** * 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); } /** * 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); } /** * 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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); 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.ExportCustomJobList]'; } } Bulkexports/V1/Export/ExportCustomJobInstance.php 0000644 00000005561 15107452326 0016156 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Bulkexports\V1\Export; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $friendlyName * @property string $resourceType * @property string $startDay * @property string $endDay * @property string $webhookUrl * @property string $webhookMethod * @property string $email * @property string $jobSid * @property array $details * @property string $jobQueuePosition * @property string $estimatedCompletionTime */ class ExportCustomJobInstance extends InstanceResource { /** * Initialize the ExportCustomJobInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $resourceType The type of communication – Messages, Calls, * Conferences, and Participants */ public function __construct(Version $version, array $payload, string $resourceType) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Bulkexports/V1/Export/DayList.php 0000644 00000011307 15107452326 0012726 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Bulkexports\V1\Export; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class DayList extends ListResource { /** * Construct the DayList * * @param Version $version Version that contains the resource * @param string $resourceType The type of communication – Messages, Calls, * Conferences, and Participants */ public function __construct(Version $version, string $resourceType) { parent::__construct($version); // Path Solution $this->solution = ['resourceType' => $resourceType, ]; $this->uri = '/Exports/' . \rawurlencode($resourceType) . '/Days'; } /** * Streams DayInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 date of the data in the file */ 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]'; } } Bulkexports/V1/Export/DayContext.php 0000644 00000003376 15107452326 0013446 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Bulkexports\V1\Export; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class DayContext extends InstanceContext { /** * Initialize the DayContext * * @param Version $version Version that contains the resource * @param string $resourceType The type of communication – Messages, Calls, * Conferences, and Participants * @param string $day The date of the data in the file */ public function __construct(Version $version, $resourceType, $day) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Bulkexports/V1/Export/DayInstance.php 0000644 00000006501 15107452326 0013557 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Bulkexports\V1\Export; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $redirectTo * @property string $day * @property int $size * @property string $createDate * @property string $friendlyName * @property string $resourceType */ class DayInstance extends InstanceResource { /** * Initialize the DayInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $resourceType The type of communication – Messages, Calls, * Conferences, and Participants * @param string $day The date of the data in the file */ public function __construct(Version $version, array $payload, string $resourceType, string $day = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Bulkexports/V1/ExportConfigurationPage.php 0000644 00000002320 15107452326 0014675 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Bulkexports\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ExportConfigurationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Bulkexports/V1.php 0000644 00000005273 15107452326 0010101 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Bulkexports; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Bulkexports\V1\ExportConfigurationList; use Twilio\Rest\Bulkexports\V1\ExportList; use Twilio\Version; /** * @property ExportList $exports * @property ExportConfigurationList $exportConfiguration * @method \Twilio\Rest\Bulkexports\V1\ExportContext exports(string $resourceType) * @method \Twilio\Rest\Bulkexports\V1\ExportConfigurationContext exportConfiguration(string $resourceType) */ class V1 extends Version { protected $_exports; protected $_exportConfiguration; /** * Construct the V1 version of Bulkexports * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->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]'; } } Client.php 0000644 00000104370 15107452326 0006505 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Exceptions\ConfigurationException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Client as HttpClient; use Twilio\Http\CurlClient; use Twilio\Security\RequestValidator; use Twilio\VersionInfo; /** * A client for accessing the Twilio API. * * @property Accounts $accounts * @property Api $api * @property Autopilot $autopilot * @property Chat $chat * @property Content $content * @property Conversations $conversations * @property Events $events * @property FlexApi $flexApi * @property FrontlineApi $frontlineApi * @property Insights $insights * @property IpMessaging $ipMessaging * @property Lookups $lookups * @property Media $media * @property Messaging $messaging * @property Monitor $monitor * @property Notify $notify * @property Numbers $numbers * @property Oauth $oauth * @property Preview $preview * @property Pricing $pricing * @property Proxy $proxy * @property Routes $routes * @property Serverless $serverless * @property Studio $studio * @property Sync $sync * @property Taskrouter $taskrouter * @property Trunking $trunking * @property Trusthub $trusthub * @property Verify $verify * @property Video $video * @property Voice $voice * @property Wireless $wireless * @property Supersim $supersim * @property Bulkexports $bulkexports * @property Microvisor $microvisor * @property \Twilio\Rest\Api\V2010\AccountInstance $account * @property \Twilio\Rest\Api\V2010\Account\AddressList $addresses * @property \Twilio\Rest\Api\V2010\Account\ApplicationList $applications * @property \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList $authorizedConnectApps * @property \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList $availablePhoneNumbers * @property \Twilio\Rest\Api\V2010\Account\BalanceList $balance * @property \Twilio\Rest\Api\V2010\Account\CallList $calls * @property \Twilio\Rest\Api\V2010\Account\ConferenceList $conferences * @property \Twilio\Rest\Api\V2010\Account\ConnectAppList $connectApps * @property \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList $incomingPhoneNumbers * @property \Twilio\Rest\Api\V2010\Account\KeyList $keys * @property \Twilio\Rest\Api\V2010\Account\MessageList $messages * @property \Twilio\Rest\Api\V2010\Account\NewKeyList $newKeys * @property \Twilio\Rest\Api\V2010\Account\NewSigningKeyList $newSigningKeys * @property \Twilio\Rest\Api\V2010\Account\NotificationList $notifications * @property \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList $outgoingCallerIds * @property \Twilio\Rest\Api\V2010\Account\QueueList $queues * @property \Twilio\Rest\Api\V2010\Account\RecordingList $recordings * @property \Twilio\Rest\Api\V2010\Account\SigningKeyList $signingKeys * @property \Twilio\Rest\Api\V2010\Account\SipList $sip * @property \Twilio\Rest\Api\V2010\Account\ShortCodeList $shortCodes * @property \Twilio\Rest\Api\V2010\Account\TokenList $tokens * @property \Twilio\Rest\Api\V2010\Account\TranscriptionList $transcriptions * @property \Twilio\Rest\Api\V2010\Account\UsageList $usage * @property \Twilio\Rest\Api\V2010\Account\ValidationRequestList $validationRequests * @method \Twilio\Rest\Api\V2010\AccountContext accounts(string $sid) * @method \Twilio\Rest\Api\V2010\Account\AddressContext addresses(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ApplicationContext applications(string $sid) * @method \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppContext authorizedConnectApps(string $connectAppSid) * @method \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryContext availablePhoneNumbers(string $countryCode) * @method \Twilio\Rest\Api\V2010\Account\CallContext calls(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ConferenceContext conferences(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ConnectAppContext connectApps(string $sid) * @method \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberContext incomingPhoneNumbers(string $sid) * @method \Twilio\Rest\Api\V2010\Account\KeyContext keys(string $sid) * @method \Twilio\Rest\Api\V2010\Account\MessageContext messages(string $sid) * @method \Twilio\Rest\Api\V2010\Account\NotificationContext notifications(string $sid) * @method \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdContext outgoingCallerIds(string $sid) * @method \Twilio\Rest\Api\V2010\Account\QueueContext queues(string $sid) * @method \Twilio\Rest\Api\V2010\Account\RecordingContext recordings(string $sid) * @method \Twilio\Rest\Api\V2010\Account\SigningKeyContext signingKeys(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ShortCodeContext shortCodes(string $sid) * @method \Twilio\Rest\Api\V2010\Account\TranscriptionContext transcriptions(string $sid) */ class Client { const ENV_ACCOUNT_SID = 'TWILIO_ACCOUNT_SID'; const ENV_AUTH_TOKEN = 'TWILIO_AUTH_TOKEN'; const ENV_REGION = 'TWILIO_REGION'; const ENV_EDGE = 'TWILIO_EDGE'; const DEFAULT_REGION = 'us1'; const ENV_LOG = 'TWILIO_LOG_LEVEL'; protected $username; protected $password; protected $accountSid; protected $region; protected $edge; protected $httpClient; protected $environment; protected $userAgentExtensions; protected $logLevel; protected $_account; protected $_accounts; protected $_api; protected $_autopilot; protected $_chat; protected $_content; protected $_conversations; protected $_events; protected $_flexApi; protected $_frontlineApi; protected $_insights; protected $_ipMessaging; protected $_lookups; protected $_media; protected $_messaging; protected $_monitor; protected $_notify; protected $_numbers; protected $_oauth; protected $_preview; protected $_pricing; protected $_proxy; protected $_routes; protected $_serverless; protected $_studio; protected $_sync; protected $_taskrouter; protected $_trunking; protected $_trusthub; protected $_verify; protected $_video; protected $_voice; protected $_wireless; protected $_supersim; protected $_bulkexports; protected $_microvisor; /** * Initializes the Twilio Client * * @param string $username Username to authenticate with * @param string $password Password to authenticate with * @param string $accountSid Account SID to authenticate with, defaults to * $username * @param string $region Region to send requests to, defaults to 'us1' if Edge * provided * @param HttpClient $httpClient HttpClient, defaults to CurlClient * @param mixed[] $environment Environment to look for auth details, defaults * to $_ENV * @param string[] $userAgentExtensions Additions to the user agent string * @throws ConfigurationException If valid authentication is not present */ public function __construct(string $username = null, string $password = null, string $accountSid = null, string $region = null, HttpClient $httpClient = null, array $environment = null, array $userAgentExtensions = null) { $this->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); } /** * 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); } /** * Access the Accounts Twilio Domain * * @return Accounts Accounts Twilio Domain */ protected function getAccounts(): Accounts { if (!$this->_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; } /** * @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; } protected function getAddresses(): \Twilio\Rest\Api\V2010\Account\AddressList { return $this->api->v2010->account->addresses; } /** * @param string $sid The unique string that identifies the resource */ 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 unique string that identifies the resource */ 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 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 unique string that identifies this resource */ 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 unique string that identifies the resource */ 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 unique string that identifies the resource */ 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 unique string that identifies the resource */ 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 unique string that identifies the resource */ 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 unique string that identifies the resource */ 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 unique string that identifies the resource */ 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 unique string that identifies this resource */ 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 unique string that identifies the resource */ protected function contextRecordings(string $sid): \Twilio\Rest\Api\V2010\Account\RecordingContext { return $this->api->v2010->account->recordings($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 getShortCodes(): \Twilio\Rest\Api\V2010\Account\ShortCodeList { return $this->api->v2010->account->shortCodes; } /** * @param string $sid The unique string that identifies this resource */ protected function contextShortCodes(string $sid): \Twilio\Rest\Api\V2010\Account\ShortCodeContext { return $this->api->v2010->account->shortCodes($sid); } 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 unique string that identifies the resource */ 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; } /** * Access the Autopilot Twilio Domain * * @return Autopilot Autopilot Twilio Domain */ protected function getAutopilot(): Autopilot { if (!$this->_autopilot) { $this->_autopilot = new Autopilot($this); } return $this->_autopilot; } /** * 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 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 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 Media Twilio Domain * * @return Media Media Twilio Domain */ protected function getMedia(): Media { if (!$this->_media) { $this->_media = new Media($this); } return $this->_media; } /** * 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 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 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; } /** * 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 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 Microvisor Twilio Domain * * @return Microvisor Microvisor Twilio Domain */ protected function getMicrovisor(): Microvisor { if (!$this->_microvisor) { $this->_microvisor = new Microvisor($this); } return $this->_microvisor; } /** * 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://api.twilio.com:8443'); if ($response->getStatusCode() < 200 || $response->getStatusCode() > 300) { throw new TwilioException('Failed to validate SSL certificate'); } } } Content.php 0000644 00000005303 15107452326 0006675 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Content\V1; /** * @property \Twilio\Rest\Content\V1 $v1 * @property \Twilio\Rest\Content\V1\ContentList $contents * @property \Twilio\Rest\Content\V1\LegacyContentList $legacyContents * @method \Twilio\Rest\Content\V1\ContentContext contents(string $sid) */ class Content extends Domain { protected $_v1; /** * Construct the Content Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->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; } /** * 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); } protected function getContents(): \Twilio\Rest\Content\V1\ContentList { return $this->v1->contents; } /** * @param string $sid The unique string that identifies the resource */ protected function contextContents(string $sid): \Twilio\Rest\Content\V1\ContentContext { return $this->v1->contents($sid); } protected function getLegacyContents(): \Twilio\Rest\Content\V1\LegacyContentList { return $this->v1->legacyContents; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Content]'; } } Wireless.php 0000644 00000007150 15107452326 0007062 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Wireless\V1; /** * @property \Twilio\Rest\Wireless\V1 $v1 * @property \Twilio\Rest\Wireless\V1\UsageRecordList $usageRecords * @property \Twilio\Rest\Wireless\V1\CommandList $commands * @property \Twilio\Rest\Wireless\V1\RatePlanList $ratePlans * @property \Twilio\Rest\Wireless\V1\SimList $sims * @method \Twilio\Rest\Wireless\V1\CommandContext commands(string $sid) * @method \Twilio\Rest\Wireless\V1\RatePlanContext ratePlans(string $sid) * @method \Twilio\Rest\Wireless\V1\SimContext sims(string $sid) */ class Wireless extends Domain { protected $_v1; /** * Construct the Wireless Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->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); } protected function getUsageRecords(): \Twilio\Rest\Wireless\V1\UsageRecordList { return $this->v1->usageRecords; } protected function getCommands(): \Twilio\Rest\Wireless\V1\CommandList { return $this->v1->commands; } /** * @param string $sid The SID that identifies the resource to fetch */ protected function contextCommands(string $sid): \Twilio\Rest\Wireless\V1\CommandContext { return $this->v1->commands($sid); } protected function getRatePlans(): \Twilio\Rest\Wireless\V1\RatePlanList { return $this->v1->ratePlans; } /** * @param string $sid The SID that identifies the resource to fetch */ protected function contextRatePlans(string $sid): \Twilio\Rest\Wireless\V1\RatePlanContext { return $this->v1->ratePlans($sid); } protected function getSims(): \Twilio\Rest\Wireless\V1\SimList { return $this->v1->sims; } /** * @param string $sid The SID of the Sim resource to fetch */ protected function contextSims(string $sid): \Twilio\Rest\Wireless\V1\SimContext { return $this->v1->sims($sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Wireless]'; } } Oauth.php 0000644 00000006707 15107452326 0006354 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Oauth\V1; /** * @property \Twilio\Rest\Oauth\V1 $v1 * @property \Twilio\Rest\Oauth\V1\OauthList $oauth * @property \Twilio\Rest\Oauth\V1\DeviceCodeList $deviceCode * @property \Twilio\Rest\Oauth\V1\OpenidDiscoveryList $openidDiscovery * @property \Twilio\Rest\Oauth\V1\TokenList $token * @property \Twilio\Rest\Oauth\V1\UserInfoList $userInfo * @method \Twilio\Rest\Oauth\V1\OauthContext oauth() * @method \Twilio\Rest\Oauth\V1\OpenidDiscoveryContext openidDiscovery() * @method \Twilio\Rest\Oauth\V1\UserInfoContext userInfo() */ class Oauth extends Domain { protected $_v1; /** * Construct the Oauth Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->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); } protected function getOauth(): \Twilio\Rest\Oauth\V1\OauthList { return $this->v1->oauth; } protected function contextOauth(): \Twilio\Rest\Oauth\V1\OauthContext { return $this->v1->oauth(); } protected function getDeviceCode(): \Twilio\Rest\Oauth\V1\DeviceCodeList { return $this->v1->deviceCode; } protected function getOpenidDiscovery(): \Twilio\Rest\Oauth\V1\OpenidDiscoveryList { return $this->v1->openidDiscovery; } protected function contextOpenidDiscovery(): \Twilio\Rest\Oauth\V1\OpenidDiscoveryContext { return $this->v1->openidDiscovery(); } protected function getToken(): \Twilio\Rest\Oauth\V1\TokenList { return $this->v1->token; } protected function getUserInfo(): \Twilio\Rest\Oauth\V1\UserInfoList { return $this->v1->userInfo; } protected function contextUserInfo(): \Twilio\Rest\Oauth\V1\UserInfoContext { return $this->v1->userInfo(); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Oauth]'; } } Trunking/V1/TrunkOptions.php 0000644 00000040551 15107452326 0012035 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1; use Twilio\Options; use Twilio\Values; abstract class TrunkOptions { /** * @param string $friendlyName A string to describe the resource * @param string $domainName The unique address you reserve on Twilio to which * you route your SIP traffic * @param string $disasterRecoveryUrl The HTTP URL that we should call if an * error occurs while sending SIP traffic * towards your configured Origination URL * @param string $disasterRecoveryMethod The HTTP method we should use to call * the disaster_recovery_url * @param string $transferMode The call transfer settings for the trunk * @param bool $secure Whether Secure Trunking is enabled for the trunk * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup should * be enabled for the trunk * @param string $transferCallerId Caller Id for transfer target * @return CreateTrunkOptions Options builder */ public static function create(string $friendlyName = Values::NONE, string $domainName = Values::NONE, string $disasterRecoveryUrl = Values::NONE, string $disasterRecoveryMethod = Values::NONE, string $transferMode = Values::NONE, bool $secure = Values::NONE, bool $cnamLookupEnabled = Values::NONE, string $transferCallerId = Values::NONE): CreateTrunkOptions { return new CreateTrunkOptions($friendlyName, $domainName, $disasterRecoveryUrl, $disasterRecoveryMethod, $transferMode, $secure, $cnamLookupEnabled, $transferCallerId); } /** * @param string $friendlyName A string to describe the resource * @param string $domainName The unique address you reserve on Twilio to which * you route your SIP traffic * @param string $disasterRecoveryUrl The HTTP URL that we should call if an * error occurs while sending SIP traffic * towards your configured Origination URL * @param string $disasterRecoveryMethod The HTTP method we should use to call * the disaster_recovery_url * @param string $transferMode The call transfer settings for the trunk * @param bool $secure Whether Secure Trunking is enabled for the trunk * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup should * be enabled for the trunk * @param string $transferCallerId Caller Id for transfer target * @return UpdateTrunkOptions Options builder */ public static function update(string $friendlyName = Values::NONE, string $domainName = Values::NONE, string $disasterRecoveryUrl = Values::NONE, string $disasterRecoveryMethod = Values::NONE, string $transferMode = Values::NONE, bool $secure = Values::NONE, bool $cnamLookupEnabled = Values::NONE, string $transferCallerId = Values::NONE): UpdateTrunkOptions { return new UpdateTrunkOptions($friendlyName, $domainName, $disasterRecoveryUrl, $disasterRecoveryMethod, $transferMode, $secure, $cnamLookupEnabled, $transferCallerId); } } class CreateTrunkOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $domainName The unique address you reserve on Twilio to which * you route your SIP traffic * @param string $disasterRecoveryUrl The HTTP URL that we should call if an * error occurs while sending SIP traffic * towards your configured Origination URL * @param string $disasterRecoveryMethod The HTTP method we should use to call * the disaster_recovery_url * @param string $transferMode The call transfer settings for the trunk * @param bool $secure Whether Secure Trunking is enabled for the trunk * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup should * be enabled for the trunk * @param string $transferCallerId Caller Id for transfer target */ 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::NONE, bool $cnamLookupEnabled = Values::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 string to describe the resource * @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 * @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 HTTP URL that we should call if an * error occurs while sending SIP traffic * towards your configured Origination URL * @return $this Fluent Builder */ public function setDisasterRecoveryUrl(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 * @return $this Fluent Builder */ public function setDisasterRecoveryMethod(string $disasterRecoveryMethod): self { $this->options['disasterRecoveryMethod'] = $disasterRecoveryMethod; return $this; } /** * The call transfer settings for the trunk. Can be: `enable-all`, `sip-only` and `disable-all`. See [Transfer](https://www.twilio.com/docs/sip-trunking/call-transfer) for more information. * * @param string $transferMode The call transfer settings for the trunk * @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 * @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 * @return $this Fluent Builder */ public function setCnamLookupEnabled(bool $cnamLookupEnabled): self { $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; return $this; } /** * Caller Id for transfer target. Can be: `from-transferee` (default) or `from-transferor`. * * @param string $transferCallerId Caller Id for transfer target * @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 string to describe the resource * @param string $domainName The unique address you reserve on Twilio to which * you route your SIP traffic * @param string $disasterRecoveryUrl The HTTP URL that we should call if an * error occurs while sending SIP traffic * towards your configured Origination URL * @param string $disasterRecoveryMethod The HTTP method we should use to call * the disaster_recovery_url * @param string $transferMode The call transfer settings for the trunk * @param bool $secure Whether Secure Trunking is enabled for the trunk * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup should * be enabled for the trunk * @param string $transferCallerId Caller Id for transfer target */ 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::NONE, bool $cnamLookupEnabled = Values::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 string to describe the resource * @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 * @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 HTTP URL that we should call if an * error occurs while sending SIP traffic * towards your configured Origination URL * @return $this Fluent Builder */ public function setDisasterRecoveryUrl(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 * @return $this Fluent Builder */ public function setDisasterRecoveryMethod(string $disasterRecoveryMethod): self { $this->options['disasterRecoveryMethod'] = $disasterRecoveryMethod; return $this; } /** * The call transfer settings for the trunk. Can be: `enable-all`, `sip-only` and `disable-all`. See [Transfer](https://www.twilio.com/docs/sip-trunking/call-transfer) for more information. * * @param string $transferMode The call transfer settings for the trunk * @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 * @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 * @return $this Fluent Builder */ public function setCnamLookupEnabled(bool $cnamLookupEnabled): self { $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; return $this; } /** * Caller Id for transfer target. Can be: `from-transferee` (default) or `from-transferor`. * * @param string $transferCallerId Caller Id for transfer target * @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 . ']'; } } Trunking/V1/TrunkPage.php 0000644 00000002163 15107452326 0011253 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class TrunkPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Trunking/V1/TrunkInstance.php 0000644 00000014245 15107452326 0012147 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Trunking\V1\Trunk\CredentialListList; use Twilio\Rest\Trunking\V1\Trunk\IpAccessControlListList; use Twilio\Rest\Trunking\V1\Trunk\OriginationUrlList; use Twilio\Rest\Trunking\V1\Trunk\PhoneNumberList; use Twilio\Rest\Trunking\V1\Trunk\RecordingList; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $domainName * @property string $disasterRecoveryMethod * @property string $disasterRecoveryUrl * @property string $friendlyName * @property bool $secure * @property array $recording * @property string $transferMode * @property string $transferCallerId * @property bool $cnamLookupEnabled * @property string $authType * @property string[] $authTypeSet * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $sid * @property string $url * @property array $links */ class TrunkInstance extends InstanceResource { protected $_originationUrls; protected $_credentialsLists; protected $_ipAccessControlLists; protected $_phoneNumbers; protected $_recordings; /** * Initialize the TrunkInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the TrunkInstance * * @return TrunkInstance Fetched TrunkInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TrunkInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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 originationUrls */ protected function getOriginationUrls(): OriginationUrlList { return $this->proxy()->originationUrls; } /** * Access the credentialsLists */ protected function getCredentialsLists(): CredentialListList { return $this->proxy()->credentialsLists; } /** * Access the ipAccessControlLists */ protected function getIpAccessControlLists(): IpAccessControlListList { return $this->proxy()->ipAccessControlLists; } /** * Access the phoneNumbers */ protected function getPhoneNumbers(): PhoneNumberList { return $this->proxy()->phoneNumbers; } /** * 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) . ']'; } } Trunking/V1/TrunkContext.php 0000644 00000015074 15107452326 0012030 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Trunking\V1\Trunk\CredentialListList; use Twilio\Rest\Trunking\V1\Trunk\IpAccessControlListList; use Twilio\Rest\Trunking\V1\Trunk\OriginationUrlList; use Twilio\Rest\Trunking\V1\Trunk\PhoneNumberList; use Twilio\Rest\Trunking\V1\Trunk\RecordingList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property OriginationUrlList $originationUrls * @property CredentialListList $credentialsLists * @property IpAccessControlListList $ipAccessControlLists * @property PhoneNumberList $phoneNumbers * @property RecordingList $recordings * @method \Twilio\Rest\Trunking\V1\Trunk\OriginationUrlContext originationUrls(string $sid) * @method \Twilio\Rest\Trunking\V1\Trunk\CredentialListContext credentialsLists(string $sid) * @method \Twilio\Rest\Trunking\V1\Trunk\IpAccessControlListContext ipAccessControlLists(string $sid) * @method \Twilio\Rest\Trunking\V1\Trunk\PhoneNumberContext phoneNumbers(string $sid) * @method \Twilio\Rest\Trunking\V1\Trunk\RecordingContext recordings() */ class TrunkContext extends InstanceContext { protected $_originationUrls; protected $_credentialsLists; protected $_ipAccessControlLists; protected $_phoneNumbers; protected $_recordings; /** * Initialize the TrunkContext * * @param Version $version Version that contains the resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Trunks/' . \rawurlencode($sid) . ''; } /** * Fetch the TrunkInstance * * @return TrunkInstance Fetched TrunkInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TrunkInstance { $payload = $this->version->fetch('GET', $this->uri); return new TrunkInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the TrunkInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the TrunkInstance * * @param array|Options $options Optional Arguments * @return TrunkInstance Updated TrunkInstance * @throws TwilioException When an HTTP error occurs. */ public function update(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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new TrunkInstance($this->version, $payload, $this->solution['sid']); } /** * Access the originationUrls */ protected function getOriginationUrls(): OriginationUrlList { if (!$this->_originationUrls) { $this->_originationUrls = new OriginationUrlList($this->version, $this->solution['sid']); } return $this->_originationUrls; } /** * Access the credentialsLists */ protected function getCredentialsLists(): CredentialListList { if (!$this->_credentialsLists) { $this->_credentialsLists = new CredentialListList($this->version, $this->solution['sid']); } return $this->_credentialsLists; } /** * 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 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) . ']'; } } Trunking/V1/TrunkList.php 0000644 00000013104 15107452326 0011307 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class TrunkList extends ListResource { /** * Construct the TrunkList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new TrunkInstance($this->version, $payload); } /** * Streams TrunkInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 identifies the resource */ 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]'; } } Trunking/V1/Trunk/IpAccessControlListPage.php 0000644 00000002360 15107452326 0015141 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class IpAccessControlListPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Trunking/V1/Trunk/RecordingList.php 0000644 00000002047 15107452326 0013227 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\ListResource; use Twilio\Version; class RecordingList extends ListResource { /** * Construct the RecordingList * * @param Version $version Version that contains the resource * @param string $trunkSid The unique string that identifies the resource */ public function __construct(Version $version, string $trunkSid) { parent::__construct($version); // Path Solution $this->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]'; } } Trunking/V1/Trunk/OriginationUrlPage.php 0000644 00000002322 15107452326 0014215 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class OriginationUrlPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Trunking/V1/Trunk/RecordingOptions.php 0000644 00000004014 15107452327 0013744 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Options; use Twilio\Values; abstract class RecordingOptions { /** * @param string $mode The recording mode for the trunk. * @param string $trim The recording trim setting for the trunk. * @return UpdateRecordingOptions Options builder */ public static function update(string $mode = Values::NONE, string $trim = Values::NONE): UpdateRecordingOptions { return new UpdateRecordingOptions($mode, $trim); } } class UpdateRecordingOptions extends Options { /** * @param string $mode The recording mode for the trunk. * @param string $trim The recording trim setting for the trunk. */ public function __construct(string $mode = Values::NONE, string $trim = Values::NONE) { $this->options['mode'] = $mode; $this->options['trim'] = $trim; } /** * The recording mode for the trunk. Can be do-not-record (default), record-from-ringing, record-from-answer, record-from-ringing-dual, or record-from-answer-dual. * * @param string $mode The recording mode for the trunk. * @return $this Fluent Builder */ public function setMode(string $mode): self { $this->options['mode'] = $mode; return $this; } /** * The recording trim setting for the trunk. Can be do-not-trim (default) or trim-silence. * * @param string $trim The recording trim setting for the trunk. * @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 . ']'; } } Trunking/V1/Trunk/RecordingContext.php 0000644 00000004270 15107452327 0013741 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class RecordingContext extends InstanceContext { /** * Initialize the RecordingContext * * @param Version $version Version that contains the resource * @param string $trunkSid The SID of the Trunk from which to fetch the * recording settings. */ public function __construct(Version $version, $trunkSid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } Trunking/V1/Trunk/CredentialListPage.php 0000644 00000002322 15107452327 0014157 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CredentialListPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Trunking/V1/Trunk/PhoneNumberPage.php 0000644 00000002300 15107452327 0013467 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class PhoneNumberPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Trunking/V1/Trunk/RecordingInstance.php 0000644 00000006052 15107452327 0014061 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $mode * @property string $trim */ class RecordingInstance extends InstanceResource { /** * Initialize the RecordingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $trunkSid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $trunkSid) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Trunking/V1/Trunk/IpAccessControlListInstance.php 0000644 00000007622 15107452327 0016040 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $sid * @property string $trunkSid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class IpAccessControlListInstance extends InstanceResource { /** * Initialize the IpAccessControlListInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $trunkSid The SID of the Trunk the resource is associated with * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $trunkSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the IpAccessControlListInstance * * @return IpAccessControlListInstance Fetched IpAccessControlListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): IpAccessControlListInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Trunking/V1/Trunk/PhoneNumberContext.php 0000644 00000004102 15107452327 0014241 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class PhoneNumberContext extends InstanceContext { /** * Initialize the PhoneNumberContext * * @param Version $version Version that contains the resource * @param string $trunkSid The SID of the Trunk from which to fetch the * PhoneNumber resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $trunkSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['trunkSid' => $trunkSid, 'sid' => $sid, ]; $this->uri = '/Trunks/' . \rawurlencode($trunkSid) . '/PhoneNumbers/' . \rawurlencode($sid) . ''; } /** * Fetch the PhoneNumberInstance * * @return PhoneNumberInstance Fetched PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PhoneNumberInstance { $payload = $this->version->fetch('GET', $this->uri); return new PhoneNumberInstance( $this->version, $payload, $this->solution['trunkSid'], $this->solution['sid'] ); } /** * Delete the PhoneNumberInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Trunking/V1/Trunk/IpAccessControlListList.php 0000644 00000013366 15107452327 0015211 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class IpAccessControlListList extends ListResource { /** * Construct the IpAccessControlListList * * @param Version $version Version that contains the resource * @param string $trunkSid The SID of the Trunk the resource is associated with */ public function __construct(Version $version, string $trunkSid) { parent::__construct($version); // Path Solution $this->solution = ['trunkSid' => $trunkSid, ]; $this->uri = '/Trunks/' . \rawurlencode($trunkSid) . '/IpAccessControlLists'; } /** * Create the IpAccessControlListInstance * * @param string $ipAccessControlListSid The SID of the IP Access Control List * 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, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new IpAccessControlListInstance($this->version, $payload, $this->solution['trunkSid']); } /** * Streams IpAccessControlListInstance records from the API as a generator * stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 identifies the resource */ 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]'; } } Trunking/V1/Trunk/OriginationUrlContext.php 0000644 00000006051 15107452327 0014771 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class OriginationUrlContext extends InstanceContext { /** * Initialize the OriginationUrlContext * * @param Version $version Version that contains the resource * @param string $trunkSid The SID of the Trunk from which to fetch the * OriginationUrl * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $trunkSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['trunkSid' => $trunkSid, 'sid' => $sid, ]; $this->uri = '/Trunks/' . \rawurlencode($trunkSid) . '/OriginationUrls/' . \rawurlencode($sid) . ''; } /** * Fetch the OriginationUrlInstance * * @return OriginationUrlInstance Fetched OriginationUrlInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): OriginationUrlInstance { $payload = $this->version->fetch('GET', $this->uri); return new OriginationUrlInstance( $this->version, $payload, $this->solution['trunkSid'], $this->solution['sid'] ); } /** * Delete the OriginationUrlInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the OriginationUrlInstance * * @param array|Options $options Optional Arguments * @return OriginationUrlInstance Updated OriginationUrlInstance * @throws TwilioException When an HTTP error occurs. */ public function update(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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new OriginationUrlInstance( $this->version, $payload, $this->solution['trunkSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trunking.V1.OriginationUrlContext ' . \implode(' ', $context) . ']'; } } Trunking/V1/Trunk/OriginationUrlInstance.php 0000644 00000011045 15107452327 0015110 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $sid * @property string $trunkSid * @property int $weight * @property bool $enabled * @property string $sipUrl * @property string $friendlyName * @property int $priority * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class OriginationUrlInstance extends InstanceResource { /** * Initialize the OriginationUrlInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $trunkSid The SID of the Trunk that owns the Origination URL * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $trunkSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the OriginationUrlInstance * * @return OriginationUrlInstance Fetched OriginationUrlInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): OriginationUrlInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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) . ']'; } } Trunking/V1/Trunk/RecordingPage.php 0000644 00000002264 15107452327 0013172 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RecordingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Trunking/V1/Trunk/OriginationUrlOptions.php 0000644 00000010777 15107452327 0015012 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Options; use Twilio\Values; abstract class OriginationUrlOptions { /** * @param int $weight The value that determines the relative load the URI * should receive compared to others with the same priority * @param int $priority The relative importance of the URI * @param bool $enabled Whether the URL is enabled * @param string $friendlyName A string to describe the resource * @param string $sipUrl The SIP address you want Twilio to route your * Origination calls to * @return UpdateOriginationUrlOptions Options builder */ public static function update(int $weight = Values::NONE, int $priority = Values::NONE, bool $enabled = Values::NONE, string $friendlyName = Values::NONE, string $sipUrl = Values::NONE): UpdateOriginationUrlOptions { return new UpdateOriginationUrlOptions($weight, $priority, $enabled, $friendlyName, $sipUrl); } } class UpdateOriginationUrlOptions extends Options { /** * @param int $weight The value that determines the relative load the URI * should receive compared to others with the same priority * @param int $priority The relative importance of the URI * @param bool $enabled Whether the URL is enabled * @param string $friendlyName A string to describe the resource * @param string $sipUrl The SIP address you want Twilio to route your * Origination calls to */ public function __construct(int $weight = Values::NONE, int $priority = Values::NONE, bool $enabled = Values::NONE, string $friendlyName = Values::NONE, string $sipUrl = Values::NONE) { $this->options['weight'] = $weight; $this->options['priority'] = $priority; $this->options['enabled'] = $enabled; $this->options['friendlyName'] = $friendlyName; $this->options['sipUrl'] = $sipUrl; } /** * The value that determines the relative share of the load the URI should receive compared to other URIs with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. URLs with higher values receive more load than those with lower ones with the same priority. * * @param int $weight The value that determines the relative load the URI * should receive compared to others with the same priority * @return $this Fluent Builder */ public function setWeight(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 * @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 * @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 string to describe the resource * @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 * @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 . ']'; } } Trunking/V1/Trunk/CredentialListInstance.php 0000644 00000007522 15107452327 0015056 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $sid * @property string $trunkSid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class CredentialListInstance extends InstanceResource { /** * Initialize the CredentialListInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $trunkSid The SID of the Trunk the credential list in * associated with * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $trunkSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the CredentialListInstance * * @return CredentialListInstance Fetched CredentialListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialListInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Trunking/V1/Trunk/PhoneNumberList.php 0000644 00000012767 15107452327 0013550 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class PhoneNumberList extends ListResource { /** * Construct the PhoneNumberList * * @param Version $version Version that contains the resource * @param string $trunkSid The SID of the Trunk that handles calls to the phone * number */ public function __construct(Version $version, string $trunkSid) { parent::__construct($version); // Path Solution $this->solution = ['trunkSid' => $trunkSid, ]; $this->uri = '/Trunks/' . \rawurlencode($trunkSid) . '/PhoneNumbers'; } /** * Create the PhoneNumberInstance * * @param string $phoneNumberSid The SID of the Incoming Phone Number 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, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new PhoneNumberInstance($this->version, $payload, $this->solution['trunkSid']); } /** * Streams PhoneNumberInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 identifies the resource */ 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]'; } } Trunking/V1/Trunk/CredentialListList.php 0000644 00000013113 15107452327 0014216 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class CredentialListList extends ListResource { /** * Construct the CredentialListList * * @param Version $version Version that contains the resource * @param string $trunkSid The SID of the Trunk the credential list in * associated with */ public function __construct(Version $version, string $trunkSid) { parent::__construct($version); // Path Solution $this->solution = ['trunkSid' => $trunkSid, ]; $this->uri = '/Trunks/' . \rawurlencode($trunkSid) . '/CredentialLists'; } /** * Create the CredentialListInstance * * @param string $credentialListSid The SID of the Credential List that you * want to associate with the trunk * @return CredentialListInstance Created CredentialListInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $credentialListSid): CredentialListInstance { $data = Values::of(['CredentialListSid' => $credentialListSid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CredentialListInstance($this->version, $payload, $this->solution['trunkSid']); } /** * Streams CredentialListInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 identifies the resource */ 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]'; } } Trunking/V1/Trunk/CredentialListContext.php 0000644 00000004133 15107452327 0014731 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class CredentialListContext extends InstanceContext { /** * Initialize the CredentialListContext * * @param Version $version Version that contains the resource * @param string $trunkSid The SID of the Trunk from which to fetch the * credential list * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $trunkSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['trunkSid' => $trunkSid, 'sid' => $sid, ]; $this->uri = '/Trunks/' . \rawurlencode($trunkSid) . '/CredentialLists/' . \rawurlencode($sid) . ''; } /** * Fetch the CredentialListInstance * * @return CredentialListInstance Fetched CredentialListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialListInstance { $payload = $this->version->fetch('GET', $this->uri); return new CredentialListInstance( $this->version, $payload, $this->solution['trunkSid'], $this->solution['sid'] ); } /** * Delete the CredentialListInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Trunking/V1/Trunk/IpAccessControlListContext.php 0000644 00000004224 15107452327 0015713 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class IpAccessControlListContext extends InstanceContext { /** * Initialize the IpAccessControlListContext * * @param Version $version Version that contains the resource * @param string $trunkSid The SID of the Trunk from which to fetch the IP * Access Control List * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $trunkSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['trunkSid' => $trunkSid, 'sid' => $sid, ]; $this->uri = '/Trunks/' . \rawurlencode($trunkSid) . '/IpAccessControlLists/' . \rawurlencode($sid) . ''; } /** * Fetch the IpAccessControlListInstance * * @return IpAccessControlListInstance Fetched IpAccessControlListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): IpAccessControlListInstance { $payload = $this->version->fetch('GET', $this->uri); return new IpAccessControlListInstance( $this->version, $payload, $this->solution['trunkSid'], $this->solution['sid'] ); } /** * Delete the IpAccessControlListInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Trunking/V1/Trunk/PhoneNumberInstance.php 0000644 00000013632 15107452327 0014371 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $addressRequirements * @property string $apiVersion * @property bool $beta * @property array $capabilities * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property array $links * @property string $phoneNumber * @property string $sid * @property string $smsApplicationSid * @property string $smsFallbackMethod * @property string $smsFallbackUrl * @property string $smsMethod * @property string $smsUrl * @property string $statusCallback * @property string $statusCallbackMethod * @property string $trunkSid * @property string $url * @property string $voiceApplicationSid * @property bool $voiceCallerIdLookup * @property string $voiceFallbackMethod * @property string $voiceFallbackUrl * @property string $voiceMethod * @property string $voiceUrl */ class PhoneNumberInstance extends InstanceResource { /** * Initialize the PhoneNumberInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $trunkSid The SID of the Trunk that handles calls to the phone * number * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $trunkSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the PhoneNumberInstance * * @return PhoneNumberInstance Fetched PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PhoneNumberInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Trunking/V1/Trunk/OriginationUrlList.php 0000644 00000014140 15107452327 0014256 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class OriginationUrlList extends ListResource { /** * Construct the OriginationUrlList * * @param Version $version Version that contains the resource * @param string $trunkSid The SID of the Trunk that owns the Origination URL */ public function __construct(Version $version, string $trunkSid) { parent::__construct($version); // Path Solution $this->solution = ['trunkSid' => $trunkSid, ]; $this->uri = '/Trunks/' . \rawurlencode($trunkSid) . '/OriginationUrls'; } /** * Create the OriginationUrlInstance * * @param int $weight The value that determines the relative load the URI * should receive compared to others with the same priority * @param int $priority The relative importance of the URI * @param bool $enabled Whether the URL is enabled * @param string $friendlyName A string to describe the resource * @param string $sipUrl The SIP address you want Twilio to route your * Origination calls to * @return OriginationUrlInstance 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, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new OriginationUrlInstance($this->version, $payload, $this->solution['trunkSid']); } /** * Streams OriginationUrlInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 identifies the resource */ 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]'; } } Trunking/V1.php 0000644 00000004222 15107452327 0007352 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Trunking\V1\TrunkList; use Twilio\Version; /** * @property TrunkList $trunks * @method \Twilio\Rest\Trunking\V1\TrunkContext trunks(string $sid) */ class V1 extends Version { protected $_trunks; /** * Construct the V1 version of Trunking * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->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]'; } } IpMessaging.php 0000644 00000006425 15107452327 0007500 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\IpMessaging\V1; use Twilio\Rest\IpMessaging\V2; /** * @property \Twilio\Rest\IpMessaging\V1 $v1 * @property \Twilio\Rest\IpMessaging\V2 $v2 * @property \Twilio\Rest\IpMessaging\V2\CredentialList $credentials * @property \Twilio\Rest\IpMessaging\V2\ServiceList $services * @method \Twilio\Rest\IpMessaging\V2\CredentialContext credentials(string $sid) * @method \Twilio\Rest\IpMessaging\V2\ServiceContext services(string $sid) */ class IpMessaging extends Domain { protected $_v1; protected $_v2; /** * Construct the IpMessaging Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->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); } protected function getCredentials(): \Twilio\Rest\IpMessaging\V2\CredentialList { return $this->v2->credentials; } /** * @param string $sid The sid */ protected function contextCredentials(string $sid): \Twilio\Rest\IpMessaging\V2\CredentialContext { return $this->v2->credentials($sid); } protected function getServices(): \Twilio\Rest\IpMessaging\V2\ServiceList { return $this->v2->services; } /** * @param string $sid The sid */ protected function contextServices(string $sid): \Twilio\Rest\IpMessaging\V2\ServiceContext { return $this->v2->services($sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging]'; } } Events.php 0000644 00000007636 15107452327 0006543 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Events\V1; /** * @property \Twilio\Rest\Events\V1 $v1 * @property \Twilio\Rest\Events\V1\EventTypeList $eventTypes * @property \Twilio\Rest\Events\V1\SchemaList $schemas * @property \Twilio\Rest\Events\V1\SinkList $sinks * @property \Twilio\Rest\Events\V1\SubscriptionList $subscriptions * @method \Twilio\Rest\Events\V1\EventTypeContext eventTypes(string $type) * @method \Twilio\Rest\Events\V1\SchemaContext schemas(string $id) * @method \Twilio\Rest\Events\V1\SinkContext sinks(string $sid) * @method \Twilio\Rest\Events\V1\SubscriptionContext subscriptions(string $sid) */ class Events extends Domain { protected $_v1; /** * Construct the Events Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->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); } protected function getEventTypes(): \Twilio\Rest\Events\V1\EventTypeList { return $this->v1->eventTypes; } /** * @param string $type A string that uniquely identifies this Event Type. */ protected function contextEventTypes(string $type): \Twilio\Rest\Events\V1\EventTypeContext { return $this->v1->eventTypes($type); } protected function getSchemas(): \Twilio\Rest\Events\V1\SchemaList { return $this->v1->schemas; } /** * @param string $id The unique identifier of the schema. */ protected function contextSchemas(string $id): \Twilio\Rest\Events\V1\SchemaContext { return $this->v1->schemas($id); } protected function getSinks(): \Twilio\Rest\Events\V1\SinkList { return $this->v1->sinks; } /** * @param string $sid A string that uniquely identifies this Sink. */ protected function contextSinks(string $sid): \Twilio\Rest\Events\V1\SinkContext { return $this->v1->sinks($sid); } protected function getSubscriptions(): \Twilio\Rest\Events\V1\SubscriptionList { return $this->v1->subscriptions; } /** * @param string $sid A string that uniquely identifies this Subscription. */ protected function contextSubscriptions(string $sid): \Twilio\Rest\Events\V1\SubscriptionContext { return $this->v1->subscriptions($sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Events]'; } } Api/V2010.php 0000644 00000024426 15107452327 0006514 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Api\V2010\AccountContext; use Twilio\Rest\Api\V2010\AccountInstance; use Twilio\Rest\Api\V2010\AccountList; use Twilio\Version; /** * @property AccountList $accounts * @method \Twilio\Rest\Api\V2010\AccountContext accounts(string $sid) * @property AccountContext $account * @property \Twilio\Rest\Api\V2010\Account\AddressList $addresses * @property \Twilio\Rest\Api\V2010\Account\ApplicationList $applications * @property \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList $authorizedConnectApps * @property \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList $availablePhoneNumbers * @property \Twilio\Rest\Api\V2010\Account\BalanceList $balance * @property \Twilio\Rest\Api\V2010\Account\CallList $calls * @property \Twilio\Rest\Api\V2010\Account\ConferenceList $conferences * @property \Twilio\Rest\Api\V2010\Account\ConnectAppList $connectApps * @property \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList $incomingPhoneNumbers * @property \Twilio\Rest\Api\V2010\Account\KeyList $keys * @property \Twilio\Rest\Api\V2010\Account\MessageList $messages * @property \Twilio\Rest\Api\V2010\Account\NewKeyList $newKeys * @property \Twilio\Rest\Api\V2010\Account\NewSigningKeyList $newSigningKeys * @property \Twilio\Rest\Api\V2010\Account\NotificationList $notifications * @property \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList $outgoingCallerIds * @property \Twilio\Rest\Api\V2010\Account\QueueList $queues * @property \Twilio\Rest\Api\V2010\Account\RecordingList $recordings * @property \Twilio\Rest\Api\V2010\Account\SigningKeyList $signingKeys * @property \Twilio\Rest\Api\V2010\Account\SipList $sip * @property \Twilio\Rest\Api\V2010\Account\ShortCodeList $shortCodes * @property \Twilio\Rest\Api\V2010\Account\TokenList $tokens * @property \Twilio\Rest\Api\V2010\Account\TranscriptionList $transcriptions * @property \Twilio\Rest\Api\V2010\Account\UsageList $usage * @property \Twilio\Rest\Api\V2010\Account\ValidationRequestList $validationRequests * @method \Twilio\Rest\Api\V2010\Account\AddressContext addresses(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ApplicationContext applications(string $sid) * @method \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppContext authorizedConnectApps(string $connectAppSid) * @method \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryContext availablePhoneNumbers(string $countryCode) * @method \Twilio\Rest\Api\V2010\Account\CallContext calls(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ConferenceContext conferences(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ConnectAppContext connectApps(string $sid) * @method \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberContext incomingPhoneNumbers(string $sid) * @method \Twilio\Rest\Api\V2010\Account\KeyContext keys(string $sid) * @method \Twilio\Rest\Api\V2010\Account\MessageContext messages(string $sid) * @method \Twilio\Rest\Api\V2010\Account\NotificationContext notifications(string $sid) * @method \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdContext outgoingCallerIds(string $sid) * @method \Twilio\Rest\Api\V2010\Account\QueueContext queues(string $sid) * @method \Twilio\Rest\Api\V2010\Account\RecordingContext recordings(string $sid) * @method \Twilio\Rest\Api\V2010\Account\SigningKeyContext signingKeys(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ShortCodeContext shortCodes(string $sid) * @method \Twilio\Rest\Api\V2010\Account\TranscriptionContext transcriptions(string $sid) */ class V2010 extends Version { protected $_accounts; protected $_account = null; protected $_addresses = null; protected $_applications = null; protected $_authorizedConnectApps = null; protected $_availablePhoneNumbers = null; protected $_balance = null; protected $_calls = null; protected $_conferences = null; protected $_connectApps = null; protected $_incomingPhoneNumbers = null; protected $_keys = null; protected $_messages = null; protected $_newKeys = null; protected $_newSigningKeys = null; protected $_notifications = null; protected $_outgoingCallerIds = null; protected $_queues = null; protected $_recordings = null; protected $_signingKeys = null; protected $_sip = null; protected $_shortCodes = null; protected $_tokens = null; protected $_transcriptions = null; protected $_usage = null; protected $_validationRequests = null; /** * Construct the V2010 version of Api * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->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 getAddresses(): \Twilio\Rest\Api\V2010\Account\AddressList { return $this->account->addresses; } protected function getApplications(): \Twilio\Rest\Api\V2010\Account\ApplicationList { return $this->account->applications; } protected function getAuthorizedConnectApps(): \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList { return $this->account->authorizedConnectApps; } protected function getAvailablePhoneNumbers(): \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList { return $this->account->availablePhoneNumbers; } protected function getBalance(): \Twilio\Rest\Api\V2010\Account\BalanceList { return $this->account->balance; } protected function getCalls(): \Twilio\Rest\Api\V2010\Account\CallList { return $this->account->calls; } protected function getConferences(): \Twilio\Rest\Api\V2010\Account\ConferenceList { return $this->account->conferences; } protected function getConnectApps(): \Twilio\Rest\Api\V2010\Account\ConnectAppList { return $this->account->connectApps; } protected function getIncomingPhoneNumbers(): \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList { return $this->account->incomingPhoneNumbers; } protected function getKeys(): \Twilio\Rest\Api\V2010\Account\KeyList { return $this->account->keys; } protected function getMessages(): \Twilio\Rest\Api\V2010\Account\MessageList { return $this->account->messages; } protected function getNewKeys(): \Twilio\Rest\Api\V2010\Account\NewKeyList { return $this->account->newKeys; } protected function getNewSigningKeys(): \Twilio\Rest\Api\V2010\Account\NewSigningKeyList { return $this->account->newSigningKeys; } protected function getNotifications(): \Twilio\Rest\Api\V2010\Account\NotificationList { return $this->account->notifications; } protected function getOutgoingCallerIds(): \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList { return $this->account->outgoingCallerIds; } protected function getQueues(): \Twilio\Rest\Api\V2010\Account\QueueList { return $this->account->queues; } protected function getRecordings(): \Twilio\Rest\Api\V2010\Account\RecordingList { return $this->account->recordings; } protected function getSigningKeys(): \Twilio\Rest\Api\V2010\Account\SigningKeyList { return $this->account->signingKeys; } protected function getSip(): \Twilio\Rest\Api\V2010\Account\SipList { return $this->account->sip; } protected function getShortCodes(): \Twilio\Rest\Api\V2010\Account\ShortCodeList { return $this->account->shortCodes; } protected function getTokens(): \Twilio\Rest\Api\V2010\Account\TokenList { return $this->account->tokens; } protected function getTranscriptions(): \Twilio\Rest\Api\V2010\Account\TranscriptionList { return $this->account->transcriptions; } protected function getUsage(): \Twilio\Rest\Api\V2010\Account\UsageList { return $this->account->usage; } protected function getValidationRequests(): \Twilio\Rest\Api\V2010\Account\ValidationRequestList { return $this->account->validationRequests; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(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]'; } } Api/V2010/AccountPage.php 0000644 00000002171 15107452327 0010676 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AccountPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/AccountContext.php 0000644 00000034527 15107452327 0011460 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Api\V2010\Account\AddressList; use Twilio\Rest\Api\V2010\Account\ApplicationList; use Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList; use Twilio\Rest\Api\V2010\Account\BalanceList; use Twilio\Rest\Api\V2010\Account\CallList; use Twilio\Rest\Api\V2010\Account\ConferenceList; use Twilio\Rest\Api\V2010\Account\ConnectAppList; use Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList; use Twilio\Rest\Api\V2010\Account\KeyList; use Twilio\Rest\Api\V2010\Account\MessageList; use Twilio\Rest\Api\V2010\Account\NewKeyList; use Twilio\Rest\Api\V2010\Account\NewSigningKeyList; use Twilio\Rest\Api\V2010\Account\NotificationList; use Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList; use Twilio\Rest\Api\V2010\Account\QueueList; use Twilio\Rest\Api\V2010\Account\RecordingList; use Twilio\Rest\Api\V2010\Account\ShortCodeList; use Twilio\Rest\Api\V2010\Account\SigningKeyList; use Twilio\Rest\Api\V2010\Account\SipList; use Twilio\Rest\Api\V2010\Account\TokenList; use Twilio\Rest\Api\V2010\Account\TranscriptionList; use Twilio\Rest\Api\V2010\Account\UsageList; use Twilio\Rest\Api\V2010\Account\ValidationRequestList; use Twilio\Values; use Twilio\Version; /** * @property AddressList $addresses * @property ApplicationList $applications * @property AuthorizedConnectAppList $authorizedConnectApps * @property AvailablePhoneNumberCountryList $availablePhoneNumbers * @property BalanceList $balance * @property CallList $calls * @property ConferenceList $conferences * @property ConnectAppList $connectApps * @property IncomingPhoneNumberList $incomingPhoneNumbers * @property KeyList $keys * @property MessageList $messages * @property NewKeyList $newKeys * @property NewSigningKeyList $newSigningKeys * @property NotificationList $notifications * @property OutgoingCallerIdList $outgoingCallerIds * @property QueueList $queues * @property RecordingList $recordings * @property SigningKeyList $signingKeys * @property SipList $sip * @property ShortCodeList $shortCodes * @property TokenList $tokens * @property TranscriptionList $transcriptions * @property UsageList $usage * @property ValidationRequestList $validationRequests * @method \Twilio\Rest\Api\V2010\Account\AddressContext addresses(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ApplicationContext applications(string $sid) * @method \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppContext authorizedConnectApps(string $connectAppSid) * @method \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryContext availablePhoneNumbers(string $countryCode) * @method \Twilio\Rest\Api\V2010\Account\CallContext calls(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ConferenceContext conferences(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ConnectAppContext connectApps(string $sid) * @method \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberContext incomingPhoneNumbers(string $sid) * @method \Twilio\Rest\Api\V2010\Account\KeyContext keys(string $sid) * @method \Twilio\Rest\Api\V2010\Account\MessageContext messages(string $sid) * @method \Twilio\Rest\Api\V2010\Account\NotificationContext notifications(string $sid) * @method \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdContext outgoingCallerIds(string $sid) * @method \Twilio\Rest\Api\V2010\Account\QueueContext queues(string $sid) * @method \Twilio\Rest\Api\V2010\Account\RecordingContext recordings(string $sid) * @method \Twilio\Rest\Api\V2010\Account\SigningKeyContext signingKeys(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ShortCodeContext shortCodes(string $sid) * @method \Twilio\Rest\Api\V2010\Account\TranscriptionContext transcriptions(string $sid) */ class AccountContext extends InstanceContext { protected $_addresses; protected $_applications; protected $_authorizedConnectApps; protected $_availablePhoneNumbers; protected $_balance; protected $_calls; protected $_conferences; protected $_connectApps; protected $_incomingPhoneNumbers; protected $_keys; protected $_messages; protected $_newKeys; protected $_newSigningKeys; protected $_notifications; protected $_outgoingCallerIds; protected $_queues; protected $_recordings; protected $_signingKeys; protected $_sip; protected $_shortCodes; protected $_tokens; protected $_transcriptions; protected $_usage; protected $_validationRequests; /** * Initialize the AccountContext * * @param Version $version Version that contains the resource * @param string $sid Fetch by unique Account Sid */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new AccountInstance($this->version, $payload, $this->solution['sid']); } /** * Access the addresses */ protected function getAddresses(): AddressList { if (!$this->_addresses) { $this->_addresses = new AddressList($this->version, $this->solution['sid']); } return $this->_addresses; } /** * Access the applications */ protected function getApplications(): ApplicationList { if (!$this->_applications) { $this->_applications = new ApplicationList($this->version, $this->solution['sid']); } return $this->_applications; } /** * Access the authorizedConnectApps */ protected function getAuthorizedConnectApps(): AuthorizedConnectAppList { if (!$this->_authorizedConnectApps) { $this->_authorizedConnectApps = new AuthorizedConnectAppList( $this->version, $this->solution['sid'] ); } return $this->_authorizedConnectApps; } /** * Access the availablePhoneNumbers */ protected function getAvailablePhoneNumbers(): AvailablePhoneNumberCountryList { if (!$this->_availablePhoneNumbers) { $this->_availablePhoneNumbers = new AvailablePhoneNumberCountryList( $this->version, $this->solution['sid'] ); } return $this->_availablePhoneNumbers; } /** * Access the balance */ protected function getBalance(): BalanceList { if (!$this->_balance) { $this->_balance = new BalanceList($this->version, $this->solution['sid']); } return $this->_balance; } /** * Access the calls */ protected function getCalls(): CallList { if (!$this->_calls) { $this->_calls = new CallList($this->version, $this->solution['sid']); } return $this->_calls; } /** * Access the conferences */ protected function getConferences(): ConferenceList { if (!$this->_conferences) { $this->_conferences = new ConferenceList($this->version, $this->solution['sid']); } return $this->_conferences; } /** * Access the connectApps */ protected function getConnectApps(): ConnectAppList { if (!$this->_connectApps) { $this->_connectApps = new ConnectAppList($this->version, $this->solution['sid']); } return $this->_connectApps; } /** * Access the incomingPhoneNumbers */ protected function getIncomingPhoneNumbers(): IncomingPhoneNumberList { if (!$this->_incomingPhoneNumbers) { $this->_incomingPhoneNumbers = new IncomingPhoneNumberList($this->version, $this->solution['sid']); } return $this->_incomingPhoneNumbers; } /** * Access the keys */ protected function getKeys(): KeyList { if (!$this->_keys) { $this->_keys = new KeyList($this->version, $this->solution['sid']); } return $this->_keys; } /** * Access the messages */ protected function getMessages(): MessageList { if (!$this->_messages) { $this->_messages = new MessageList($this->version, $this->solution['sid']); } return $this->_messages; } /** * Access the newKeys */ protected function getNewKeys(): NewKeyList { if (!$this->_newKeys) { $this->_newKeys = new NewKeyList($this->version, $this->solution['sid']); } return $this->_newKeys; } /** * Access the newSigningKeys */ protected function getNewSigningKeys(): NewSigningKeyList { if (!$this->_newSigningKeys) { $this->_newSigningKeys = new NewSigningKeyList($this->version, $this->solution['sid']); } return $this->_newSigningKeys; } /** * Access the notifications */ protected function getNotifications(): NotificationList { if (!$this->_notifications) { $this->_notifications = new NotificationList($this->version, $this->solution['sid']); } return $this->_notifications; } /** * Access the outgoingCallerIds */ protected function getOutgoingCallerIds(): OutgoingCallerIdList { if (!$this->_outgoingCallerIds) { $this->_outgoingCallerIds = new OutgoingCallerIdList($this->version, $this->solution['sid']); } return $this->_outgoingCallerIds; } /** * Access the queues */ protected function getQueues(): QueueList { if (!$this->_queues) { $this->_queues = new QueueList($this->version, $this->solution['sid']); } return $this->_queues; } /** * Access the recordings */ protected function getRecordings(): RecordingList { if (!$this->_recordings) { $this->_recordings = new RecordingList($this->version, $this->solution['sid']); } return $this->_recordings; } /** * Access the signingKeys */ protected function getSigningKeys(): SigningKeyList { if (!$this->_signingKeys) { $this->_signingKeys = new SigningKeyList($this->version, $this->solution['sid']); } return $this->_signingKeys; } /** * Access the sip */ protected function getSip(): SipList { if (!$this->_sip) { $this->_sip = new SipList($this->version, $this->solution['sid']); } return $this->_sip; } /** * Access the shortCodes */ protected function getShortCodes(): ShortCodeList { if (!$this->_shortCodes) { $this->_shortCodes = new ShortCodeList($this->version, $this->solution['sid']); } return $this->_shortCodes; } /** * Access the tokens */ protected function getTokens(): TokenList { if (!$this->_tokens) { $this->_tokens = new TokenList($this->version, $this->solution['sid']); } return $this->_tokens; } /** * Access the transcriptions */ protected function getTranscriptions(): TranscriptionList { if (!$this->_transcriptions) { $this->_transcriptions = new TranscriptionList($this->version, $this->solution['sid']); } return $this->_transcriptions; } /** * Access the usage */ protected function getUsage(): UsageList { if (!$this->_usage) { $this->_usage = new UsageList($this->version, $this->solution['sid']); } return $this->_usage; } /** * Access the validationRequests */ protected function getValidationRequests(): ValidationRequestList { if (!$this->_validationRequests) { $this->_validationRequests = new ValidationRequestList($this->version, $this->solution['sid']); } return $this->_validationRequests; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return 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) . ']'; } } Api/V2010/AccountOptions.php 0000644 00000012017 15107452327 0011455 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010; use Twilio\Options; use Twilio\Values; abstract class AccountOptions { /** * @param string $friendlyName A human readable description of the account * @return CreateAccountOptions Options builder */ public static function create(string $friendlyName = Values::NONE): CreateAccountOptions { return new CreateAccountOptions($friendlyName); } /** * @param string $friendlyName FriendlyName to filter on * @param string $status Status to filter on * @return ReadAccountOptions Options builder */ public static function read(string $friendlyName = Values::NONE, string $status = Values::NONE): ReadAccountOptions { return new ReadAccountOptions($friendlyName, $status); } /** * @param string $friendlyName FriendlyName to update * @param string $status Status to update the Account with * @return UpdateAccountOptions Options builder */ public static function update(string $friendlyName = Values::NONE, string $status = Values::NONE): UpdateAccountOptions { return new UpdateAccountOptions($friendlyName, $status); } } class CreateAccountOptions extends Options { /** * @param string $friendlyName A human readable description of the account */ public function __construct(string $friendlyName = Values::NONE) { $this->options['friendlyName'] = $friendlyName; } /** * A human readable description of the account to create, defaults to `SubAccount Created at {YYYY-MM-DD HH:MM meridian}` * * @param string $friendlyName A human readable description of the account * @return $this Fluent Builder */ public function setFriendlyName(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 FriendlyName to filter on * @param string $status Status to filter on */ 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 FriendlyName to filter on * @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 Status to filter on * @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 FriendlyName to update * @param string $status Status to update the Account with */ 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 FriendlyName to update * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Alter the status of this account: use `closed` to irreversibly close this account, `suspended` to temporarily suspend it, or `active` to reactivate it. * * @param string $status Status to update the Account with * @return $this Fluent Builder */ public function setStatus(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 . ']'; } } Api/V2010/AccountList.php 0000644 00000013013 15107452327 0010732 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class AccountList extends ListResource { /** * Construct the AccountList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AccountInstance($this->version, $payload); } /** * Streams AccountInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of AccountInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 Fetch by unique Account Sid */ 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]'; } } Api/V2010/Account/AuthorizedConnectAppList.php 0000644 00000012052 15107452327 0015025 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class AuthorizedConnectAppList extends ListResource { /** * Construct the AuthorizedConnectAppList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/AuthorizedConnectApps.json'; } /** * Streams AuthorizedConnectAppInstance records from the API as a generator * stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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]'; } } Api/V2010/Account/BalanceList.php 0000644 00000002511 15107452327 0012260 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class BalanceList extends ListResource { /** * Construct the BalanceList * * @param Version $version Version that contains the resource * @param string $accountSid Account Sid. */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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]'; } } Api/V2010/Account/CallContext.php 0000644 00000022605 15107452327 0012325 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Api\V2010\Account\Call\EventList; use Twilio\Rest\Api\V2010\Account\Call\FeedbackList; use Twilio\Rest\Api\V2010\Account\Call\NotificationList; use Twilio\Rest\Api\V2010\Account\Call\PaymentList; use Twilio\Rest\Api\V2010\Account\Call\RecordingList; use Twilio\Rest\Api\V2010\Account\Call\SiprecList; use Twilio\Rest\Api\V2010\Account\Call\StreamList; use Twilio\Rest\Api\V2010\Account\Call\UserDefinedMessageList; use Twilio\Rest\Api\V2010\Account\Call\UserDefinedMessageSubscriptionList; use Twilio\Values; use Twilio\Version; /** * @property RecordingList $recordings * @property NotificationList $notifications * @property FeedbackList $feedback * @property EventList $events * @property PaymentList $payments * @property SiprecList $siprec * @property StreamList $streams * @property UserDefinedMessageSubscriptionList $userDefinedMessageSubscriptions * @property UserDefinedMessageList $userDefinedMessages * @method \Twilio\Rest\Api\V2010\Account\Call\RecordingContext recordings(string $sid) * @method \Twilio\Rest\Api\V2010\Account\Call\NotificationContext notifications(string $sid) * @method \Twilio\Rest\Api\V2010\Account\Call\FeedbackContext feedback() * @method \Twilio\Rest\Api\V2010\Account\Call\PaymentContext payments(string $sid) * @method \Twilio\Rest\Api\V2010\Account\Call\SiprecContext siprec(string $sid) * @method \Twilio\Rest\Api\V2010\Account\Call\StreamContext streams(string $sid) * @method \Twilio\Rest\Api\V2010\Account\Call\UserDefinedMessageSubscriptionContext userDefinedMessageSubscriptions(string $sid) */ class CallContext extends InstanceContext { protected $_recordings; protected $_notifications; protected $_feedback; protected $_events; protected $_payments; protected $_siprec; protected $_streams; protected $_userDefinedMessageSubscriptions; protected $_userDefinedMessages; /** * Initialize the CallContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the * resource(s) to fetch * @param string $sid The SID of the Call resource to fetch */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->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 { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the CallInstance * * @return CallInstance Fetched CallInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CallInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new CallInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * 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 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 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 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 payments */ protected function getPayments(): PaymentList { if (!$this->_payments) { $this->_payments = new PaymentList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_payments; } /** * 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 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 userDefinedMessages */ protected function getUserDefinedMessages(): UserDefinedMessageList { if (!$this->_userDefinedMessages) { $this->_userDefinedMessages = new UserDefinedMessageList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_userDefinedMessages; } /** * 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) . ']'; } } Api/V2010/Account/TranscriptionContext.php 0000644 00000004141 15107452327 0014304 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class TranscriptionContext extends InstanceContext { /** * Initialize the TranscriptionContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Transcriptions/' . \rawurlencode($sid) . '.json'; } /** * Fetch the TranscriptionInstance * * @return TranscriptionInstance Fetched TranscriptionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TranscriptionInstance { $payload = $this->version->fetch('GET', $this->uri); return new TranscriptionInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Delete the TranscriptionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Api/V2010/Account/UsageList.php 0000644 00000005631 15107452327 0012005 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Api\V2010\Account\Usage\RecordList; use Twilio\Rest\Api\V2010\Account\Usage\TriggerList; use Twilio\Version; /** * @property RecordList $records * @property TriggerList $triggers * @method \Twilio\Rest\Api\V2010\Account\Usage\TriggerContext triggers(string $sid) */ class UsageList extends ListResource { protected $_records = null; protected $_triggers = null; /** * Construct the UsageList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->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]'; } } Api/V2010/Account/Conference/ParticipantList.php 0000644 00000023745 15107452327 0015274 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Conference; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ParticipantList extends ListResource { /** * Construct the ParticipantList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @param string $conferenceSid The SID of the conference the participant is in */ public function __construct(Version $version, string $accountSid, string $conferenceSid) { parent::__construct($version); // Path Solution $this->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. * @param string $to The phone number, SIP address or Client identifier that * received this call. * @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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ParticipantInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['conferenceSid'] ); } /** * Streams ParticipantInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of ParticipantInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 SID or URL encoded label of the participant * to fetch */ 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]'; } } Api/V2010/Account/Conference/RecordingList.php 0000644 00000013335 15107452330 0014716 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Conference; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class RecordingList extends ListResource { /** * Construct the RecordingList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @param string $conferenceSid The Conference SID that identifies the * conference associated with the recording */ public function __construct(Version $version, string $accountSid, string $conferenceSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'conferenceSid' => $conferenceSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Conferences/' . \rawurlencode($conferenceSid) . '/Recordings.json'; } /** * Streams RecordingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of RecordingInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 unique string that identifies the resource */ 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]'; } } Api/V2010/Account/Conference/ParticipantInstance.php 0000644 00000012270 15107452330 0016106 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Conference; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $callSid * @property string $label * @property string $callSidToCoach * @property bool $coaching * @property string $conferenceSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property bool $endConferenceOnExit * @property bool $muted * @property bool $hold * @property bool $startConferenceOnEnter * @property string $status * @property string $uri */ class ParticipantInstance extends InstanceResource { /** * Initialize the ParticipantInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $conferenceSid The SID of the conference the participant is in * @param string $callSid The Call SID or URL encoded label of the participant * to fetch */ public function __construct(Version $version, array $payload, string $accountSid, string $conferenceSid, string $callSid = null) { parent::__construct($version); // Marshaled Properties $this->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'), '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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Api/V2010/Account/Conference/RecordingOptions.php 0000644 00000012425 15107452330 0015435 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Conference; use Twilio\Options; use Twilio\Values; abstract class RecordingOptions { /** * @param string $pauseBehavior Whether to record during a pause * @return UpdateRecordingOptions Options builder */ public static function update(string $pauseBehavior = Values::NONE): UpdateRecordingOptions { return new UpdateRecordingOptions($pauseBehavior); } /** * @param string $dateCreatedBefore The `YYYY-MM-DD` value of the resources to * read * @param string $dateCreated The `YYYY-MM-DD` value of the resources to read * @param string $dateCreatedAfter The `YYYY-MM-DD` value of the resources to * read * @return ReadRecordingOptions Options builder */ public static function read(string $dateCreatedBefore = Values::NONE, string $dateCreated = Values::NONE, string $dateCreatedAfter = Values::NONE): ReadRecordingOptions { return new ReadRecordingOptions($dateCreatedBefore, $dateCreated, $dateCreatedAfter); } } class UpdateRecordingOptions extends Options { /** * @param string $pauseBehavior Whether to record during a pause */ 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 * @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 . ']'; } } class ReadRecordingOptions extends Options { /** * @param string $dateCreatedBefore The `YYYY-MM-DD` value of the resources to * read * @param string $dateCreated The `YYYY-MM-DD` value of the resources to read * @param string $dateCreatedAfter The `YYYY-MM-DD` value of the resources to * read */ public function __construct(string $dateCreatedBefore = Values::NONE, string $dateCreated = Values::NONE, string $dateCreatedAfter = Values::NONE) { $this->options['dateCreatedBefore'] = $dateCreatedBefore; $this->options['dateCreated'] = $dateCreated; $this->options['dateCreatedAfter'] = $dateCreatedAfter; } /** * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * * @param string $dateCreatedBefore The `YYYY-MM-DD` value of the resources to * read * @return $this Fluent Builder */ public function setDateCreatedBefore(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 `YYYY-MM-DD` value of the resources to read * @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 `YYYY-MM-DD` value of the resources to * read * @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 . ']'; } } Api/V2010/Account/Conference/RecordingContext.php 0000644 00000006171 15107452330 0015427 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Conference; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class RecordingContext extends InstanceContext { /** * Initialize the RecordingContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $conferenceSid Fetch by unique Conference SID for the recording * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $accountSid, $conferenceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'conferenceSid' => $conferenceSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Conferences/' . \rawurlencode($conferenceSid) . '/Recordings/' . \rawurlencode($sid) . '.json'; } /** * Update the RecordingInstance * * @param string $status The new status of the recording * @param array|Options $options Optional Arguments * @return RecordingInstance Updated RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status, array $options = []): RecordingInstance { $options = new Values($options); $data = Values::of(['Status' => $status, 'PauseBehavior' => $options['pauseBehavior'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new RecordingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['conferenceSid'], $this->solution['sid'] ); } /** * Fetch the RecordingInstance * * @return RecordingInstance Fetched RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RecordingInstance { $payload = $this->version->fetch('GET', $this->uri); return new RecordingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['conferenceSid'], $this->solution['sid'] ); } /** * Delete the RecordingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Api/V2010/Account/Conference/ParticipantContext.php 0000644 00000007701 15107452330 0015771 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Conference; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class ParticipantContext extends InstanceContext { /** * Initialize the ParticipantContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $conferenceSid The SID of the conference with the participant * to fetch * @param string $callSid The Call SID or URL encoded label of the participant * to fetch */ public function __construct(Version $version, $accountSid, $conferenceSid, $callSid) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'conferenceSid' => $conferenceSid, 'callSid' => $callSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Conferences/' . \rawurlencode($conferenceSid) . '/Participants/' . \rawurlencode($callSid) . '.json'; } /** * Fetch the ParticipantInstance * * @return ParticipantInstance Fetched ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ParticipantInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ParticipantInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['conferenceSid'], $this->solution['callSid'] ); } /** * Delete the ParticipantInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Api/V2010/Account/Conference/RecordingInstance.php 0000644 00000012766 15107452330 0015556 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Conference; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property string $callSid * @property string $conferenceSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property \DateTime $startTime * @property string $duration * @property string $sid * @property string $price * @property string $priceUnit * @property string $status * @property int $channels * @property string $source * @property int $errorCode * @property array $encryptionDetails * @property string $uri */ class RecordingInstance extends InstanceResource { /** * Initialize the RecordingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $conferenceSid The Conference SID that identifies the * conference associated with the recording * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $accountSid, string $conferenceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Update the RecordingInstance * * @param string $status The new status of the recording * @param array|Options $options Optional Arguments * @return RecordingInstance Updated RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status, array $options = []): RecordingInstance { return $this->proxy()->update($status, $options); } /** * Fetch the RecordingInstance * * @return RecordingInstance Fetched RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RecordingInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Api/V2010/Account/Conference/ParticipantOptions.php 0000644 00000164715 15107452330 0016011 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Conference; use Twilio\Options; use Twilio\Values; abstract class ParticipantOptions { /** * @param bool $muted Whether the participant should be muted * @param bool $hold Whether the participant should be on hold * @param string $holdUrl The URL we call using the `hold_method` for music * that plays when the participant is on hold * @param string $holdMethod The HTTP method we should use to call hold_url * @param string $announceUrl The URL we call using the `announce_method` for * an announcement to the participant * @param string $announceMethod The HTTP method we should use to call * announce_url * @param string $waitUrl The URL we call using the `wait_method` for the music * to play while participants are waiting for the * conference to start * @param string $waitMethod The HTTP method we should use to call `wait_url` * @param bool $beepOnExit Whether to play a notification beep to the * conference when the participant exit * @param bool $endConferenceOnExit Whether to end the conference when the * participant leaves * @param bool $coaching Indicates if the participant changed to coach * @param string $callSidToCoach The SID of the participant who is being * `coached` * @return UpdateParticipantOptions Options builder */ public static function update(bool $muted = Values::NONE, bool $hold = Values::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::NONE, bool $endConferenceOnExit = Values::NONE, bool $coaching = Values::NONE, string $callSidToCoach = Values::NONE): UpdateParticipantOptions { return new UpdateParticipantOptions($muted, $hold, $holdUrl, $holdMethod, $announceUrl, $announceMethod, $waitUrl, $waitMethod, $beepOnExit, $endConferenceOnExit, $coaching, $callSidToCoach); } /** * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod The HTTP method we should use to call * `status_callback` * @param string[] $statusCallbackEvent Set state change events that will * trigger a callback * @param string $label The label of this participant * @param int $timeout he number of seconds that we should wait for an answer * @param bool $record Whether to record the participant and their conferences * @param bool $muted Whether to mute the agent * @param string $beep Whether to play a notification beep to the conference * when the participant joins * @param bool $startConferenceOnEnter Whether the conference starts when the * participant joins the conference * @param bool $endConferenceOnExit Whether to end the conference when the * participant leaves * @param string $waitUrl URL that hosts pre-conference hold music * @param string $waitMethod The HTTP method we should use to call `wait_url` * @param bool $earlyMedia Whether agents can hear the state of the outbound * call * @param int $maxParticipants The maximum number of agent conference * participants * @param string $conferenceRecord Whether to record the conference the * participant is joining * @param string $conferenceTrim Whether to trim leading and trailing silence * from your recorded conference audio files * @param string $conferenceStatusCallback The callback URL for conference * events * @param string $conferenceStatusCallbackMethod HTTP method for requesting * `conference_status_callback` * URL * @param string[] $conferenceStatusCallbackEvent The conference state changes * that should generate a call * to * `conference_status_callback` * @param string $recordingChannels Specify `mono` or `dual` recording channels * @param string $recordingStatusCallback The URL that we should call using the * `recording_status_callback_method` * when the recording status changes * @param string $recordingStatusCallbackMethod The HTTP method we should use * when we call * `recording_status_callback` * @param string $sipAuthUsername The SIP username used for authentication * @param string $sipAuthPassword The SIP password for authentication * @param string $region The region where we should mix the conference audio * @param string $conferenceRecordingStatusCallback The URL we should call * using the * `conference_recording_status_callback_method` when the conference recording is available * @param string $conferenceRecordingStatusCallbackMethod The HTTP method we * should use to call * `conference_recording_status_callback` * @param string[] $recordingStatusCallbackEvent The recording state changes * that should generate a call to * `recording_status_callback` * @param string[] $conferenceRecordingStatusCallbackEvent The conference * recording state * changes that should * generate a call to * `conference_recording_status_callback` * @param bool $coaching Indicates if the participant changed to coach * @param string $callSidToCoach The SID of the participant who is being * `coached` * @param string $jitterBufferSize Jitter Buffer size for the connecting * participant * @param string $byoc BYOC trunk SID (Beta) * @param string $callerId The phone number, Client identifier, or username * portion of SIP address that made this call. * @param string $callReason Reason for the call (Branded Calls Beta) * @param string $recordingTrack The track(s) to record * @param int $timeLimit The maximum duration of the call in seconds. * @param string $machineDetection Enable machine detection or end of greeting * detection * @param int $machineDetectionTimeout Number of seconds to wait for machine * detection * @param int $machineDetectionSpeechThreshold Number of milliseconds for * measuring stick for the length * of the speech activity * @param int $machineDetectionSpeechEndThreshold Number of milliseconds of * silence after speech activity * @param int $machineDetectionSilenceTimeout Number of milliseconds of initial * silence * @param string $amdStatusCallback The URL we should call to send amd status * information to your application * @param string $amdStatusCallbackMethod HTTP Method to use with * amd_status_callback * @return CreateParticipantOptions Options builder */ public static function create(string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, array $statusCallbackEvent = Values::ARRAY_NONE, string $label = Values::NONE, int $timeout = Values::NONE, bool $record = Values::NONE, bool $muted = Values::NONE, string $beep = Values::NONE, bool $startConferenceOnEnter = Values::NONE, bool $endConferenceOnExit = Values::NONE, string $waitUrl = Values::NONE, string $waitMethod = Values::NONE, bool $earlyMedia = Values::NONE, int $maxParticipants = Values::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::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::NONE, string $machineDetection = Values::NONE, int $machineDetectionTimeout = Values::NONE, int $machineDetectionSpeechThreshold = Values::NONE, int $machineDetectionSpeechEndThreshold = Values::NONE, int $machineDetectionSilenceTimeout = Values::NONE, string $amdStatusCallback = Values::NONE, string $amdStatusCallbackMethod = Values::NONE): CreateParticipantOptions { return new CreateParticipantOptions($statusCallback, $statusCallbackMethod, $statusCallbackEvent, $label, $timeout, $record, $muted, $beep, $startConferenceOnEnter, $endConferenceOnExit, $waitUrl, $waitMethod, $earlyMedia, $maxParticipants, $conferenceRecord, $conferenceTrim, $conferenceStatusCallback, $conferenceStatusCallbackMethod, $conferenceStatusCallbackEvent, $recordingChannels, $recordingStatusCallback, $recordingStatusCallbackMethod, $sipAuthUsername, $sipAuthPassword, $region, $conferenceRecordingStatusCallback, $conferenceRecordingStatusCallbackMethod, $recordingStatusCallbackEvent, $conferenceRecordingStatusCallbackEvent, $coaching, $callSidToCoach, $jitterBufferSize, $byoc, $callerId, $callReason, $recordingTrack, $timeLimit, $machineDetection, $machineDetectionTimeout, $machineDetectionSpeechThreshold, $machineDetectionSpeechEndThreshold, $machineDetectionSilenceTimeout, $amdStatusCallback, $amdStatusCallbackMethod); } /** * @param bool $muted Whether to return only participants that are muted * @param bool $hold Whether to return only participants that are on hold * @param bool $coaching Whether to return only participants who are coaching * another call * @return ReadParticipantOptions Options builder */ public static function read(bool $muted = Values::NONE, bool $hold = Values::NONE, bool $coaching = Values::NONE): ReadParticipantOptions { return new ReadParticipantOptions($muted, $hold, $coaching); } } class UpdateParticipantOptions extends Options { /** * @param bool $muted Whether the participant should be muted * @param bool $hold Whether the participant should be on hold * @param string $holdUrl The URL we call using the `hold_method` for music * that plays when the participant is on hold * @param string $holdMethod The HTTP method we should use to call hold_url * @param string $announceUrl The URL we call using the `announce_method` for * an announcement to the participant * @param string $announceMethod The HTTP method we should use to call * announce_url * @param string $waitUrl The URL we call using the `wait_method` for the music * to play while participants are waiting for the * conference to start * @param string $waitMethod The HTTP method we should use to call `wait_url` * @param bool $beepOnExit Whether to play a notification beep to the * conference when the participant exit * @param bool $endConferenceOnExit Whether to end the conference when the * participant leaves * @param bool $coaching Indicates if the participant changed to coach * @param string $callSidToCoach The SID of the participant who is being * `coached` */ public function __construct(bool $muted = Values::NONE, bool $hold = Values::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::NONE, bool $endConferenceOnExit = Values::NONE, bool $coaching = Values::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 * @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 * @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 `<Play>`, `<Say>`, `<Pause>`, or `<Redirect>` verbs. * * @param string $holdUrl The URL we call using the `hold_method` for music * that plays when the participant is on hold * @return $this Fluent Builder */ public function setHoldUrl(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 * @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 `<Play>`, `<Say>`, `<Pause>`, or `<Redirect>` verbs. * * @param string $announceUrl The URL we call using the `announce_method` for * an announcement to the participant * @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 * @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 `<Play>`, `<Say>`, `<Pause>`, or `<Redirect>` 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 * @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` * @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 exit * @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 * @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 Indicates if the participant changed to coach * @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` * @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 . ']'; } } class CreateParticipantOptions extends Options { /** * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod The HTTP method we should use to call * `status_callback` * @param string[] $statusCallbackEvent Set state change events that will * trigger a callback * @param string $label The label of this participant * @param int $timeout he number of seconds that we should wait for an answer * @param bool $record Whether to record the participant and their conferences * @param bool $muted Whether to mute the agent * @param string $beep Whether to play a notification beep to the conference * when the participant joins * @param bool $startConferenceOnEnter Whether the conference starts when the * participant joins the conference * @param bool $endConferenceOnExit Whether to end the conference when the * participant leaves * @param string $waitUrl URL that hosts pre-conference hold music * @param string $waitMethod The HTTP method we should use to call `wait_url` * @param bool $earlyMedia Whether agents can hear the state of the outbound * call * @param int $maxParticipants The maximum number of agent conference * participants * @param string $conferenceRecord Whether to record the conference the * participant is joining * @param string $conferenceTrim Whether to trim leading and trailing silence * from your recorded conference audio files * @param string $conferenceStatusCallback The callback URL for conference * events * @param string $conferenceStatusCallbackMethod HTTP method for requesting * `conference_status_callback` * URL * @param string[] $conferenceStatusCallbackEvent The conference state changes * that should generate a call * to * `conference_status_callback` * @param string $recordingChannels Specify `mono` or `dual` recording channels * @param string $recordingStatusCallback The URL that we should call using the * `recording_status_callback_method` * when the recording status changes * @param string $recordingStatusCallbackMethod The HTTP method we should use * when we call * `recording_status_callback` * @param string $sipAuthUsername The SIP username used for authentication * @param string $sipAuthPassword The SIP password for authentication * @param string $region The region where we should mix the conference audio * @param string $conferenceRecordingStatusCallback The URL we should call * using the * `conference_recording_status_callback_method` when the conference recording is available * @param string $conferenceRecordingStatusCallbackMethod The HTTP method we * should use to call * `conference_recording_status_callback` * @param string[] $recordingStatusCallbackEvent The recording state changes * that should generate a call to * `recording_status_callback` * @param string[] $conferenceRecordingStatusCallbackEvent The conference * recording state * changes that should * generate a call to * `conference_recording_status_callback` * @param bool $coaching Indicates if the participant changed to coach * @param string $callSidToCoach The SID of the participant who is being * `coached` * @param string $jitterBufferSize Jitter Buffer size for the connecting * participant * @param string $byoc BYOC trunk SID (Beta) * @param string $callerId The phone number, Client identifier, or username * portion of SIP address that made this call. * @param string $callReason Reason for the call (Branded Calls Beta) * @param string $recordingTrack The track(s) to record * @param int $timeLimit The maximum duration of the call in seconds. * @param string $machineDetection Enable machine detection or end of greeting * detection * @param int $machineDetectionTimeout Number of seconds to wait for machine * detection * @param int $machineDetectionSpeechThreshold Number of milliseconds for * measuring stick for the length * of the speech activity * @param int $machineDetectionSpeechEndThreshold Number of milliseconds of * silence after speech activity * @param int $machineDetectionSilenceTimeout Number of milliseconds of initial * silence * @param string $amdStatusCallback The URL we should call to send amd status * information to your application * @param string $amdStatusCallbackMethod HTTP Method to use with * amd_status_callback */ public function __construct(string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, array $statusCallbackEvent = Values::ARRAY_NONE, string $label = Values::NONE, int $timeout = Values::NONE, bool $record = Values::NONE, bool $muted = Values::NONE, string $beep = Values::NONE, bool $startConferenceOnEnter = Values::NONE, bool $endConferenceOnExit = Values::NONE, string $waitUrl = Values::NONE, string $waitMethod = Values::NONE, bool $earlyMedia = Values::NONE, int $maxParticipants = Values::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::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::NONE, string $machineDetection = Values::NONE, int $machineDetectionTimeout = Values::NONE, int $machineDetectionSpeechThreshold = Values::NONE, int $machineDetectionSpeechEndThreshold = Values::NONE, int $machineDetectionSilenceTimeout = Values::NONE, string $amdStatusCallback = Values::NONE, string $amdStatusCallbackMethod = 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; } /** * The URL we should call using the `status_callback_method` to send status information to your application. * * @param string $statusCallback The URL we should call to send status * information to your application * @return $this Fluent Builder */ public function setStatusCallback(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` * @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 Set state change events that will * trigger a callback * @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 The label of this 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 he number of seconds that we should wait for an answer * @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 * @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 to mute the agent * @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 * @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 the conference starts when the * participant joins 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 * @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 URL that hosts pre-conference hold music * @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` * @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 agents can hear the state of the outbound * call * @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 agent conference * participants * @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 * @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 * @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 callback URL for conference * events * @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 HTTP method for requesting * `conference_status_callback` * URL * @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` * @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 Specify `mono` or `dual` recording channels * @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` * @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 where we should mix the conference audio * @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` * @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` * @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 should * generate a call to * `conference_recording_status_callback` * @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 Indicates if the participant changed to coach * @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` * @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 * @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 BYOC trunk SID (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. * @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 Reason for the call (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 track(s) to record * @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. * @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. If `send_digits` is provided, this parameter is ignored. For more information, see [Answering Machine Detection](https://www.twilio.com/docs/voice/answering-machine-detection). * * @param string $machineDetection Enable machine detection or end of greeting * detection * @return $this Fluent Builder */ public function setMachineDetection(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 Number of seconds to wait for machine * detection * @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 Number of milliseconds for * measuring stick for the length * of the speech activity * @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 Number of milliseconds of * silence after speech activity * @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 Number of milliseconds of initial * silence * @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 we should call to send amd status * information to your application * @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 HTTP Method to use with * amd_status_callback * @return $this Fluent Builder */ public function setAmdStatusCallbackMethod(string $amdStatusCallbackMethod): self { $this->options['amdStatusCallbackMethod'] = $amdStatusCallbackMethod; return $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 * @param bool $hold Whether to return only participants that are on hold * @param bool $coaching Whether to return only participants who are coaching * another call */ public function __construct(bool $muted = Values::NONE, bool $hold = Values::NONE, bool $coaching = Values::NONE) { $this->options['muted'] = $muted; $this->options['hold'] = $hold; $this->options['coaching'] = $coaching; } /** * Whether to return only participants that are muted. Can be: `true` or `false`. * * @param bool $muted Whether to return only participants that are muted * @return $this Fluent Builder */ public function setMuted(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 * @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 * @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 . ']'; } } Api/V2010/Account/Conference/RecordingPage.php 0000644 00000002446 15107452330 0014660 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Conference; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RecordingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Conference/ParticipantPage.php 0000644 00000002462 15107452330 0015220 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Conference; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ParticipantPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/SigningKeyContext.php 0000644 00000005221 15107452330 0013506 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class SigningKeyContext extends InstanceContext { /** * Initialize the SigningKeyContext * * @param Version $version Version that contains the resource * @param string $accountSid The account_sid * @param string $sid The sid */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SigningKeys/' . \rawurlencode($sid) . '.json'; } /** * Fetch the SigningKeyInstance * * @return SigningKeyInstance Fetched SigningKeyInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SigningKeyInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SigningKeyInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Delete the SigningKeyInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Api/V2010/Account/ShortCodeList.php 0000644 00000012325 15107452330 0012623 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ShortCodeList extends ListResource { /** * Construct the ShortCodeList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created this resource */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SMS/ShortCodes.json'; } /** * Streams ShortCodeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of ShortCodeInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 unique string that identifies this resource */ 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]'; } } Api/V2010/Account/BalancePage.php 0000644 00000002250 15107452330 0012213 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class BalancePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/KeyOptions.php 0000644 00000002677 15107452330 0012212 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class KeyOptions { /** * @param string $friendlyName A string to describe the resource * @return UpdateKeyOptions Options builder */ public static function update(string $friendlyName = Values::NONE): UpdateKeyOptions { return new UpdateKeyOptions($friendlyName); } } class UpdateKeyOptions extends Options { /** * @param string $friendlyName A string to describe the resource */ 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 string to describe the resource * @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 . ']'; } } Api/V2010/Account/NewKeyOptions.php 0000644 00000002721 15107452330 0012652 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class NewKeyOptions { /** * @param string $friendlyName A string to describe the resource * @return CreateNewKeyOptions Options builder */ public static function create(string $friendlyName = Values::NONE): CreateNewKeyOptions { return new CreateNewKeyOptions($friendlyName); } } class CreateNewKeyOptions extends Options { /** * @param string $friendlyName A string to describe the resource */ 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 string to describe the resource * @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 . ']'; } } Api/V2010/Account/ApplicationOptions.php 0000644 00000071757 15107452330 0013732 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class ApplicationOptions { /** * @param string $apiVersion The API version to use to start a new TwiML session * @param string $voiceUrl The URL to call when the phone number receives a call * @param string $voiceMethod The HTTP method to use with the voice_url * @param string $voiceFallbackUrl The URL to call when a TwiML error occurs * @param string $voiceFallbackMethod The HTTP method to use with * voice_fallback_url * @param string $statusCallback The URL to send status information to your * application * @param string $statusCallbackMethod The HTTP method to use to call * status_callback * @param bool $voiceCallerIdLookup Whether to lookup the caller's name * @param string $smsUrl The URL to call when the phone number receives an * incoming SMS message * @param string $smsMethod The HTTP method to use with sms_url * @param string $smsFallbackUrl The URL to call when an error occurs while * retrieving or executing the TwiML * @param string $smsFallbackMethod The HTTP method to use with sms_fallback_url * @param string $smsStatusCallback The URL to send status information to your * application * @param string $messageStatusCallback The URL to send message status * information to your application * @param string $friendlyName A string to describe the new resource * @param bool $publicApplicationConnectEnabled Whether to allow other Twilio * accounts to dial this * application * @return CreateApplicationOptions Options builder */ public static function create(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::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, string $friendlyName = Values::NONE, bool $publicApplicationConnectEnabled = Values::NONE): CreateApplicationOptions { return new CreateApplicationOptions($apiVersion, $voiceUrl, $voiceMethod, $voiceFallbackUrl, $voiceFallbackMethod, $statusCallback, $statusCallbackMethod, $voiceCallerIdLookup, $smsUrl, $smsMethod, $smsFallbackUrl, $smsFallbackMethod, $smsStatusCallback, $messageStatusCallback, $friendlyName, $publicApplicationConnectEnabled); } /** * @param string $friendlyName The string that identifies the Application * resources to read * @return ReadApplicationOptions Options builder */ public static function read(string $friendlyName = Values::NONE): ReadApplicationOptions { return new ReadApplicationOptions($friendlyName); } /** * @param string $friendlyName A string to describe the resource * @param string $apiVersion The API version to use to start a new TwiML session * @param string $voiceUrl The URL to call when the phone number receives a call * @param string $voiceMethod The HTTP method to use with the voice_url * @param string $voiceFallbackUrl The URL to call when a TwiML error occurs * @param string $voiceFallbackMethod The HTTP method to use with * voice_fallback_url * @param string $statusCallback The URL to send status information to your * application * @param string $statusCallbackMethod The HTTP method to use to call * status_callback * @param bool $voiceCallerIdLookup Whether to lookup the caller's name * @param string $smsUrl The URL to call when the phone number receives an * incoming SMS message * @param string $smsMethod The HTTP method to use with sms_url * @param string $smsFallbackUrl The URL to call when an error occurs while * retrieving or executing the TwiML * @param string $smsFallbackMethod The HTTP method to use with sms_fallback_url * @param string $smsStatusCallback Same as message_status_callback. * Deprecated, included for backwards * compatibility. * @param string $messageStatusCallback The URL to send message status * information to your application * @param bool $publicApplicationConnectEnabled Whether to allow other Twilio * accounts to dial this * application * @return UpdateApplicationOptions Options builder */ public static function update(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::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::NONE): UpdateApplicationOptions { return new UpdateApplicationOptions($friendlyName, $apiVersion, $voiceUrl, $voiceMethod, $voiceFallbackUrl, $voiceFallbackMethod, $statusCallback, $statusCallbackMethod, $voiceCallerIdLookup, $smsUrl, $smsMethod, $smsFallbackUrl, $smsFallbackMethod, $smsStatusCallback, $messageStatusCallback, $publicApplicationConnectEnabled); } } class CreateApplicationOptions extends Options { /** * @param string $apiVersion The API version to use to start a new TwiML session * @param string $voiceUrl The URL to call when the phone number receives a call * @param string $voiceMethod The HTTP method to use with the voice_url * @param string $voiceFallbackUrl The URL to call when a TwiML error occurs * @param string $voiceFallbackMethod The HTTP method to use with * voice_fallback_url * @param string $statusCallback The URL to send status information to your * application * @param string $statusCallbackMethod The HTTP method to use to call * status_callback * @param bool $voiceCallerIdLookup Whether to lookup the caller's name * @param string $smsUrl The URL to call when the phone number receives an * incoming SMS message * @param string $smsMethod The HTTP method to use with sms_url * @param string $smsFallbackUrl The URL to call when an error occurs while * retrieving or executing the TwiML * @param string $smsFallbackMethod The HTTP method to use with sms_fallback_url * @param string $smsStatusCallback The URL to send status information to your * application * @param string $messageStatusCallback The URL to send message status * information to your application * @param string $friendlyName A string to describe the new resource * @param bool $publicApplicationConnectEnabled Whether to allow other Twilio * accounts to dial this * application */ public function __construct(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::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, string $friendlyName = Values::NONE, bool $publicApplicationConnectEnabled = Values::NONE) { $this->options['apiVersion'] = $apiVersion; $this->options['voiceUrl'] = $voiceUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; $this->options['smsUrl'] = $smsUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['smsStatusCallback'] = $smsStatusCallback; $this->options['messageStatusCallback'] = $messageStatusCallback; $this->options['friendlyName'] = $friendlyName; $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 * @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 to call when the phone number 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 to use with the 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 retrieving or executing the TwiML requested by `url`. * * @param string $voiceFallbackUrl The URL to call when a TwiML error occurs * @return $this Fluent Builder */ public function setVoiceFallbackUrl(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 to use with * voice_fallback_url * @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 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 to use to call * status_callback * @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 to lookup the caller's name * @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 to 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 to use with sms_url * @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 to call when an error occurs while * retrieving or executing the TwiML * @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 to use with sms_fallback_url * @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 to send status information to your * 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 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 string to describe the new resource * @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 * application * @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 string to describe the resource * @param string $apiVersion The API version to use to start a new TwiML session * @param string $voiceUrl The URL to call when the phone number receives a call * @param string $voiceMethod The HTTP method to use with the voice_url * @param string $voiceFallbackUrl The URL to call when a TwiML error occurs * @param string $voiceFallbackMethod The HTTP method to use with * voice_fallback_url * @param string $statusCallback The URL to send status information to your * application * @param string $statusCallbackMethod The HTTP method to use to call * status_callback * @param bool $voiceCallerIdLookup Whether to lookup the caller's name * @param string $smsUrl The URL to call when the phone number receives an * incoming SMS message * @param string $smsMethod The HTTP method to use with sms_url * @param string $smsFallbackUrl The URL to call when an error occurs while * retrieving or executing the TwiML * @param string $smsFallbackMethod The HTTP method to use with sms_fallback_url * @param string $smsStatusCallback Same as message_status_callback. * Deprecated, included for backwards * compatibility. * @param string $messageStatusCallback The URL to send message status * information to your application * @param bool $publicApplicationConnectEnabled Whether to allow other Twilio * accounts to dial this * application */ 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::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::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 string to describe the resource * @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 * @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 to call when the phone number 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 to use with the 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 retrieving or executing the TwiML requested by `url`. * * @param string $voiceFallbackUrl The URL to call when a TwiML error occurs * @return $this Fluent Builder */ public function setVoiceFallbackUrl(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 to use with * voice_fallback_url * @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 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 to use to call * status_callback * @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 to lookup the caller's name * @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 to 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 to use with sms_url * @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 to call when an error occurs while * retrieving or executing the TwiML * @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 to use with sms_fallback_url * @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. * 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 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 * application * @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 . ']'; } } Api/V2010/Account/Queue/MemberOptions.php 0000644 00000002742 15107452330 0013746 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Queue; use Twilio\Options; use Twilio\Values; abstract class MemberOptions { /** * @param string $method How to pass the update request data * @return UpdateMemberOptions Options builder */ public static function update(string $method = Values::NONE): UpdateMemberOptions { return new UpdateMemberOptions($method); } } class UpdateMemberOptions extends Options { /** * @param string $method How to pass the update request data */ public function __construct(string $method = Values::NONE) { $this->options['method'] = $method; } /** * How to pass the update request data. Can be `GET` or `POST` and the default is `POST`. `POST` sends the data as encoded form data and `GET` sends the data as query parameters. * * @param string $method How to pass the update request data * @return $this Fluent Builder */ public function setMethod(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 . ']'; } } Api/V2010/Account/Queue/MemberContext.php 0000644 00000005416 15107452330 0013740 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Queue; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class MemberContext extends InstanceContext { /** * Initialize the MemberContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the * resource(s) to fetch * @param string $queueSid The SID of the Queue in which to find the members * @param string $callSid The Call SID of the resource(s) to fetch */ public function __construct(Version $version, $accountSid, $queueSid, $callSid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new MemberInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['queueSid'], $this->solution['callSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.MemberContext ' . \implode(' ', $context) . ']'; } } Api/V2010/Account/Queue/MemberList.php 0000644 00000011677 15107452330 0013235 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Queue; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class MemberList extends ListResource { /** * Construct the MemberList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created this resource * @param string $queueSid The SID of the Queue the member is in */ public function __construct(Version $version, string $accountSid, string $queueSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'queueSid' => $queueSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Queues/' . \rawurlencode($queueSid) . '/Members.json'; } /** * Streams MemberInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 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]'; } } Api/V2010/Account/Queue/MemberInstance.php 0000644 00000007742 15107452330 0014064 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Queue; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $callSid * @property \DateTime $dateEnqueued * @property int $position * @property string $uri * @property int $waitTime * @property string $queueSid */ class MemberInstance extends InstanceResource { /** * Initialize the MemberInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created this resource * @param string $queueSid The SID of the Queue the member is in * @param string $callSid The Call SID of the resource(s) to fetch */ public function __construct(Version $version, array $payload, string $accountSid, string $queueSid, string $callSid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Api/V2010/Account/Queue/MemberPage.php 0000644 00000002405 15107452330 0013163 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Queue; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MemberPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/SipList.php 0000644 00000007337 15107452330 0011473 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Api\V2010\Account\Sip\CredentialListList; use Twilio\Rest\Api\V2010\Account\Sip\DomainList; use Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlListList; use Twilio\Version; /** * @property DomainList $domains * @property IpAccessControlListList $ipAccessControlLists * @property CredentialListList $credentialLists * @method \Twilio\Rest\Api\V2010\Account\Sip\DomainContext domains(string $sid) * @method \Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlListContext ipAccessControlLists(string $sid) * @method \Twilio\Rest\Api\V2010\Account\Sip\CredentialListContext credentialLists(string $sid) */ class SipList extends ListResource { protected $_domains = null; protected $_ipAccessControlLists = null; protected $_credentialLists = null; /** * Construct the SipList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->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 ipAccessControlLists */ protected function getIpAccessControlLists(): IpAccessControlListList { if (!$this->_ipAccessControlLists) { $this->_ipAccessControlLists = new IpAccessControlListList( $this->version, $this->solution['accountSid'] ); } return $this->_ipAccessControlLists; } /** * Access the credentialLists */ protected function getCredentialLists(): CredentialListList { if (!$this->_credentialLists) { $this->_credentialLists = new CredentialListList($this->version, $this->solution['accountSid']); } return $this->_credentialLists; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(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]'; } } Api/V2010/Account/ValidationRequestPage.php 0000644 00000002344 15107452330 0014335 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ValidationRequestPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/KeyContext.php 0000644 00000005232 15107452330 0012171 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class KeyContext extends InstanceContext { /** * Initialize the KeyContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Keys/' . \rawurlencode($sid) . '.json'; } /** * Fetch the KeyInstance * * @return KeyInstance Fetched KeyInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): KeyInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new KeyInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Delete the KeyInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Api/V2010/Account/NewKeyInstance.php 0000644 00000004342 15107452331 0012765 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $secret */ class NewKeyInstance extends InstanceResource { /** * Initialize the NewKeyInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Api/V2010/Account/AvailablePhoneNumberCountryPage.php 0000644 00000002516 15107452331 0016303 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AvailablePhoneNumberCountryPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/NotificationList.php 0000644 00000012724 15107452331 0013363 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class NotificationList extends ListResource { /** * Construct the NotificationList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Notifications.json'; } /** * Streams NotificationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of NotificationInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 unique string that identifies the resource */ 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]'; } } Api/V2010/Account/ConnectAppInstance.php 0000644 00000011117 15107452331 0013613 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $authorizeRedirectUrl * @property string $companyName * @property string $deauthorizeCallbackMethod * @property string $deauthorizeCallbackUrl * @property string $description * @property string $friendlyName * @property string $homepageUrl * @property string[] $permissions * @property string $sid * @property string $uri */ class ConnectAppInstance extends InstanceResource { /** * Initialize the ConnectAppInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Api/V2010/Account/AuthorizedConnectAppContext.php 0000644 00000003662 15107452331 0015540 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class AuthorizedConnectAppContext extends InstanceContext { /** * Initialize the AuthorizedConnectAppContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $connectAppSid The SID of the Connect App to fetch */ public function __construct(Version $version, $accountSid, $connectAppSid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Api/V2010/Account/RecordingList.php 0000644 00000013106 15107452331 0012644 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class RecordingList extends ListResource { /** * Construct the RecordingList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Recordings.json'; } /** * Streams RecordingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of RecordingInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 unique string that identifies the resource */ 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]'; } } Api/V2010/Account/QueueContext.php 0000644 00000010613 15107452331 0012525 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Api\V2010\Account\Queue\MemberList; use Twilio\Values; use Twilio\Version; /** * @property MemberList $members * @method \Twilio\Rest\Api\V2010\Account\Queue\MemberContext members(string $callSid) */ class QueueContext extends InstanceContext { protected $_members; /** * Initialize the QueueContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the * resource(s) to fetch * @param string $sid The unique string that identifies this resource */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Queues/' . \rawurlencode($sid) . '.json'; } /** * Fetch the QueueInstance * * @return QueueInstance Fetched QueueInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): QueueInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new QueueInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Delete the QueueInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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) . ']'; } } Api/V2010/Account/AddressList.php 0000644 00000015623 15107452331 0012323 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class AddressList extends ListResource { /** * Construct the AddressList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that is responsible for the * resource */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AddressInstance($this->version, $payload, $this->solution['accountSid']); } /** * Streams AddressInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of AddressInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 unique string that identifies the resource */ 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]'; } } Api/V2010/Account/ConnectAppPage.php 0000644 00000002272 15107452331 0012725 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ConnectAppPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/AvailablePhoneNumberCountryInstance.php 0000644 00000012607 15107452331 0017175 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\LocalList; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\MachineToMachineList; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\MobileList; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\NationalList; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\SharedCostList; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\TollFreeList; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\VoipList; use Twilio\Values; use Twilio\Version; /** * @property string $countryCode * @property string $country * @property string $uri * @property bool $beta * @property array $subresourceUris */ class AvailablePhoneNumberCountryInstance extends InstanceResource { protected $_local; protected $_tollFree; protected $_mobile; protected $_national; protected $_voip; protected $_sharedCost; protected $_machineToMachine; /** * Initialize the AvailablePhoneNumberCountryInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @param string $countryCode The ISO country code of the country to fetch * available phone number information about */ public function __construct(Version $version, array $payload, string $accountSid, string $countryCode = null) { parent::__construct($version); // Marshaled Properties $this->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 local */ protected function getLocal(): LocalList { return $this->proxy()->local; } /** * Access the tollFree */ protected function getTollFree(): TollFreeList { return $this->proxy()->tollFree; } /** * Access the mobile */ protected function getMobile(): MobileList { return $this->proxy()->mobile; } /** * Access the national */ protected function getNational(): NationalList { return $this->proxy()->national; } /** * Access the voip */ protected function getVoip(): VoipList { return $this->proxy()->voip; } /** * Access the sharedCost */ protected function getSharedCost(): SharedCostList { return $this->proxy()->sharedCost; } /** * Access the machineToMachine */ protected function getMachineToMachine(): MachineToMachineList { return $this->proxy()->machineToMachine; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Api/V2010/Account/ValidationRequestList.php 0000644 00000004066 15107452331 0014400 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class ValidationRequestList extends ListResource { /** * Construct the ValidationRequestList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/OutgoingCallerIds.json'; } /** * Create the ValidationRequestInstance * * @param string $phoneNumber The phone number to verify in E.164 format * @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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); 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]'; } } Api/V2010/Account/SigningKeyPage.php 0000644 00000002272 15107452331 0012742 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SigningKeyPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/IncomingPhoneNumberList.php 0000644 00000023557 15107452331 0014651 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\LocalList; use Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\MobileList; use Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\TollFreeList; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * @property LocalList $local * @property MobileList $mobile * @property TollFreeList $tollFree */ class IncomingPhoneNumberList extends ListResource { protected $_local = null; protected $_mobile = null; protected $_tollFree = null; /** * Construct the IncomingPhoneNumberList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/IncomingPhoneNumbers.json'; } /** * Streams IncomingPhoneNumberInstance records from the API as a generator * stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of IncomingPhoneNumberInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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); } /** * 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([ 'PhoneNumber' => $options['phoneNumber'], 'AreaCode' => $options['areaCode'], 'ApiVersion' => $options['apiVersion'], 'FriendlyName' => $options['friendlyName'], 'SmsApplicationSid' => $options['smsApplicationSid'], 'SmsFallbackMethod' => $options['smsFallbackMethod'], 'SmsFallbackUrl' => $options['smsFallbackUrl'], 'SmsMethod' => $options['smsMethod'], 'SmsUrl' => $options['smsUrl'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'VoiceApplicationSid' => $options['voiceApplicationSid'], 'VoiceCallerIdLookup' => Serialize::booleanToString($options['voiceCallerIdLookup']), 'VoiceFallbackMethod' => $options['voiceFallbackMethod'], 'VoiceFallbackUrl' => $options['voiceFallbackUrl'], 'VoiceMethod' => $options['voiceMethod'], 'VoiceUrl' => $options['voiceUrl'], 'EmergencyStatus' => $options['emergencyStatus'], 'EmergencyAddressSid' => $options['emergencyAddressSid'], 'TrunkSid' => $options['trunkSid'], 'IdentitySid' => $options['identitySid'], 'AddressSid' => $options['addressSid'], 'VoiceReceiveMode' => $options['voiceReceiveMode'], 'BundleSid' => $options['bundleSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new IncomingPhoneNumberInstance($this->version, $payload, $this->solution['accountSid']); } /** * 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; } /** * Access the tollFree */ protected function getTollFree(): TollFreeList { if (!$this->_tollFree) { $this->_tollFree = new TollFreeList($this->version, $this->solution['accountSid']); } return $this->_tollFree; } /** * Constructs a IncomingPhoneNumberContext * * @param string $sid The unique string that identifies the resource */ public function getContext(string $sid): IncomingPhoneNumberContext { return new IncomingPhoneNumberContext($this->version, $this->solution['accountSid'], $sid); } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(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]'; } } Api/V2010/Account/NotificationPage.php 0000644 00000002306 15107452331 0013317 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class NotificationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/QueueList.php 0000644 00000012640 15107452331 0012016 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class QueueList extends ListResource { /** * Construct the QueueList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created this resource */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Queues.json'; } /** * Streams QueueInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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); } /** * Create the QueueInstance * * @param string $friendlyName A string to describe this resource * @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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new QueueInstance($this->version, $payload, $this->solution['accountSid']); } /** * Constructs a QueueContext * * @param string $sid The unique string that identifies this resource */ 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]'; } } Api/V2010/Account/RecordingOptions.php 0000644 00000020404 15107452331 0013363 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class RecordingOptions { /** * @param bool $includeSoftDeleted A boolean parameter indicating whether to * retrieve soft deleted recordings or not. * @return FetchRecordingOptions Options builder */ public static function fetch(bool $includeSoftDeleted = Values::NONE): FetchRecordingOptions { return new FetchRecordingOptions($includeSoftDeleted); } /** * @param string $dateCreatedBefore Only include recordings that were created * on this date * @param string $dateCreated Only include recordings that were created on this * date * @param string $dateCreatedAfter Only include recordings that were created on * this date * @param string $callSid The Call SID of the resources to read * @param string $conferenceSid Read by unique Conference SID for the recording * @param bool $includeSoftDeleted A boolean parameter indicating whether to * retrieve soft deleted recordings or not. * @return ReadRecordingOptions Options builder */ public static function read(string $dateCreatedBefore = Values::NONE, string $dateCreated = Values::NONE, string $dateCreatedAfter = Values::NONE, string $callSid = Values::NONE, string $conferenceSid = Values::NONE, bool $includeSoftDeleted = Values::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. */ public function __construct(bool $includeSoftDeleted = Values::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. * @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 * @param string $dateCreated Only include recordings that were created on this * date * @param string $dateCreatedAfter Only include recordings that were created on * this date * @param string $callSid The Call SID of the resources to read * @param string $conferenceSid Read by unique Conference SID for the recording * @param bool $includeSoftDeleted A boolean parameter indicating whether to * retrieve soft deleted recordings or not. */ public function __construct(string $dateCreatedBefore = Values::NONE, string $dateCreated = Values::NONE, string $dateCreatedAfter = Values::NONE, string $callSid = Values::NONE, string $conferenceSid = Values::NONE, bool $includeSoftDeleted = Values::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 * @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 * @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 * @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 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 Read by unique Conference SID for the recording * @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. * @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 . ']'; } } Api/V2010/Account/CallList.php 0000644 00000024452 15107452331 0011611 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Api\V2010\Account\Call\FeedbackSummaryList; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * @property FeedbackSummaryList $feedbackSummaries * @method \Twilio\Rest\Api\V2010\Account\Call\FeedbackSummaryContext feedbackSummaries(string $sid) */ class CallList extends ListResource { protected $_feedbackSummaries = null; /** * Construct the CallList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created this resource */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Calls.json'; } /** * Create the CallInstance * * @param string $to Phone number, SIP address, or client identifier to call * @param string $from Twilio number from which to originate the call * @param array|Options $options Optional Arguments * @return CallInstance 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, 'Url' => $options['url'], 'Twiml' => $options['twiml'], 'ApplicationSid' => $options['applicationSid'], 'Method' => $options['method'], 'FallbackUrl' => $options['fallbackUrl'], 'FallbackMethod' => $options['fallbackMethod'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackEvent' => Serialize::map($options['statusCallbackEvent'], function($e) { return $e; }), 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'SendDigits' => $options['sendDigits'], 'Timeout' => $options['timeout'], 'Record' => Serialize::booleanToString($options['record']), 'RecordingChannels' => $options['recordingChannels'], 'RecordingStatusCallback' => $options['recordingStatusCallback'], 'RecordingStatusCallbackMethod' => $options['recordingStatusCallbackMethod'], 'SipAuthUsername' => $options['sipAuthUsername'], 'SipAuthPassword' => $options['sipAuthPassword'], 'MachineDetection' => $options['machineDetection'], 'MachineDetectionTimeout' => $options['machineDetectionTimeout'], 'RecordingStatusCallbackEvent' => Serialize::map($options['recordingStatusCallbackEvent'], function($e) { return $e; }), 'Trim' => $options['trim'], 'CallerId' => $options['callerId'], 'MachineDetectionSpeechThreshold' => $options['machineDetectionSpeechThreshold'], 'MachineDetectionSpeechEndThreshold' => $options['machineDetectionSpeechEndThreshold'], 'MachineDetectionSilenceTimeout' => $options['machineDetectionSilenceTimeout'], 'AsyncAmd' => $options['asyncAmd'], 'AsyncAmdStatusCallback' => $options['asyncAmdStatusCallback'], 'AsyncAmdStatusCallbackMethod' => $options['asyncAmdStatusCallbackMethod'], 'Byoc' => $options['byoc'], 'CallReason' => $options['callReason'], 'CallToken' => $options['callToken'], 'RecordingTrack' => $options['recordingTrack'], 'TimeLimit' => $options['timeLimit'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CallInstance($this->version, $payload, $this->solution['accountSid']); } /** * Streams CallInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of CallInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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); } /** * Access the feedbackSummaries */ protected function getFeedbackSummaries(): FeedbackSummaryList { if (!$this->_feedbackSummaries) { $this->_feedbackSummaries = new FeedbackSummaryList($this->version, $this->solution['accountSid']); } return $this->_feedbackSummaries; } /** * Constructs a CallContext * * @param string $sid The SID of the Call resource to fetch */ public function getContext(string $sid): CallContext { return new CallContext($this->version, $this->solution['accountSid'], $sid); } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(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.CallList]'; } } Api/V2010/Account/IncomingPhoneNumberPage.php 0000644 00000002360 15107452331 0014577 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class IncomingPhoneNumberPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Address/DependentPhoneNumberInstance.php 0000644 00000011345 15107452331 0017222 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Address; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $friendlyName * @property string $phoneNumber * @property string $voiceUrl * @property string $voiceMethod * @property string $voiceFallbackMethod * @property string $voiceFallbackUrl * @property bool $voiceCallerIdLookup * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $smsFallbackMethod * @property string $smsFallbackUrl * @property string $smsMethod * @property string $smsUrl * @property string $addressRequirements * @property array $capabilities * @property string $statusCallback * @property string $statusCallbackMethod * @property string $apiVersion * @property string $smsApplicationSid * @property string $voiceApplicationSid * @property string $trunkSid * @property string $emergencyStatus * @property string $emergencyAddressSid * @property string $uri */ class DependentPhoneNumberInstance extends InstanceResource { /** * Initialize the DependentPhoneNumberInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $addressSid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $accountSid, string $addressSid) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Api/V2010/Account/Address/DependentPhoneNumberPage.php 0000644 00000002537 15107452331 0016335 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Address; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class DependentPhoneNumberPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Address/DependentPhoneNumberList.php 0000644 00000011530 15107452331 0016365 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Address; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class DependentPhoneNumberList extends ListResource { /** * Construct the DependentPhoneNumberList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @param string $addressSid The unique string that identifies the resource */ public function __construct(Version $version, string $accountSid, string $addressSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'addressSid' => $addressSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Addresses/' . \rawurlencode($addressSid) . '/DependentPhoneNumbers.json'; } /** * Streams DependentPhoneNumberInstance records from the API as a generator * stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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]'; } } Api/V2010/Account/RecordingContext.php 0000644 00000011344 15107452331 0013357 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Api\V2010\Account\Recording\AddOnResultList; use Twilio\Rest\Api\V2010\Account\Recording\TranscriptionList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property TranscriptionList $transcriptions * @property AddOnResultList $addOnResults * @method \Twilio\Rest\Api\V2010\Account\Recording\TranscriptionContext transcriptions(string $sid) * @method \Twilio\Rest\Api\V2010\Account\Recording\AddOnResultContext addOnResults(string $sid) */ class RecordingContext extends InstanceContext { protected $_transcriptions; protected $_addOnResults; /** * Initialize the RecordingContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Recordings/' . \rawurlencode($sid) . '.json'; } /** * 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']), ]); $payload = $this->version->fetch('GET', $this->uri, $params); return new RecordingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Delete the RecordingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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 addOnResults */ protected function getAddOnResults(): AddOnResultList { if (!$this->_addOnResults) { $this->_addOnResults = new AddOnResultList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_addOnResults; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return 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) . ']'; } } Api/V2010/Account/TranscriptionList.php 0000644 00000011517 15107452331 0013573 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class TranscriptionList extends ListResource { /** * Construct the TranscriptionList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Transcriptions.json'; } /** * Streams TranscriptionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 unique string that identifies the resource */ 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]'; } } Api/V2010/Account/QueuePage.php 0000644 00000002234 15107452331 0011755 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class QueuePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/MessageOptions.php 0000644 00000066673 15107452331 0013055 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class MessageOptions { /** * @param string $from The phone number that initiated the message * @param string $messagingServiceSid The SID of the Messaging Service you want * to associate with the message. * @param string $body The text of the message you want to send. Can be up to * 1,600 characters in length. * @param string[] $mediaUrl The URL of the media to send with the message * @param string $statusCallback The URL we should call to send status * information to your application * @param string $applicationSid The application to use for callbacks * @param string $maxPrice The total maximum price up to 4 decimal places in US * dollars acceptable for the message to be delivered. * @param bool $provideFeedback Whether to confirm delivery of the message * @param int $attempt Total numer of attempts made , this inclusive to send * out the message * @param int $validityPeriod The number of seconds that the message can remain * in our outgoing queue. * @param bool $forceDelivery Reserved * @param string $contentRetention Determines if the message content can be * stored or redacted based on privacy settings * @param string $addressRetention Determines if the address can be stored or * obfuscated based on privacy settings * @param bool $smartEncoded Whether to detect Unicode characters that have a * similar GSM-7 character and replace them * @param string[] $persistentAction Rich actions for Channels Messages. * @param bool $shortenUrls Sets whether to shorten and track links included in * the body of this message. * @param string $scheduleType Pass the value `fixed` to schedule a message at * a fixed time. * @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 will deliver the message as a * single MMS message, regardless of the presence of * media. * @param string $contentSid The SID of the preconfigured Content object you * want to associate with the message. * @param string $contentVariables Key-value pairs of variable names to * substitution values, used alongside a * content_sid. * @return CreateMessageOptions Options builder */ public static function create(string $from = Values::NONE, string $messagingServiceSid = Values::NONE, string $body = Values::NONE, array $mediaUrl = Values::ARRAY_NONE, string $statusCallback = Values::NONE, string $applicationSid = Values::NONE, string $maxPrice = Values::NONE, bool $provideFeedback = Values::NONE, int $attempt = Values::NONE, int $validityPeriod = Values::NONE, bool $forceDelivery = Values::NONE, string $contentRetention = Values::NONE, string $addressRetention = Values::NONE, bool $smartEncoded = Values::NONE, array $persistentAction = Values::ARRAY_NONE, bool $shortenUrls = Values::NONE, string $scheduleType = Values::NONE, \DateTime $sendAt = Values::NONE, bool $sendAsMms = Values::NONE, string $contentSid = Values::NONE, string $contentVariables = Values::NONE): CreateMessageOptions { return new CreateMessageOptions($from, $messagingServiceSid, $body, $mediaUrl, $statusCallback, $applicationSid, $maxPrice, $provideFeedback, $attempt, $validityPeriod, $forceDelivery, $contentRetention, $addressRetention, $smartEncoded, $persistentAction, $shortenUrls, $scheduleType, $sendAt, $sendAsMms, $contentSid, $contentVariables); } /** * @param string $to Filter by messages sent to this number * @param string $from Filter by from number * @param string $dateSentBefore Filter by date sent * @param string $dateSent Filter by date sent * @param string $dateSentAfter Filter by date sent * @return ReadMessageOptions Options builder */ public static function read(string $to = Values::NONE, string $from = Values::NONE, string $dateSentBefore = Values::NONE, string $dateSent = Values::NONE, string $dateSentAfter = Values::NONE): ReadMessageOptions { return new ReadMessageOptions($to, $from, $dateSentBefore, $dateSent, $dateSentAfter); } /** * @param string $body The text of the message you want to send * @param string $status Set as `canceled` to cancel a message from being sent. * @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 phone number that initiated the message * @param string $messagingServiceSid The SID of the Messaging Service you want * to associate with the message. * @param string $body The text of the message you want to send. Can be up to * 1,600 characters in length. * @param string[] $mediaUrl The URL of the media to send with the message * @param string $statusCallback The URL we should call to send status * information to your application * @param string $applicationSid The application to use for callbacks * @param string $maxPrice The total maximum price up to 4 decimal places in US * dollars acceptable for the message to be delivered. * @param bool $provideFeedback Whether to confirm delivery of the message * @param int $attempt Total numer of attempts made , this inclusive to send * out the message * @param int $validityPeriod The number of seconds that the message can remain * in our outgoing queue. * @param bool $forceDelivery Reserved * @param string $contentRetention Determines if the message content can be * stored or redacted based on privacy settings * @param string $addressRetention Determines if the address can be stored or * obfuscated based on privacy settings * @param bool $smartEncoded Whether to detect Unicode characters that have a * similar GSM-7 character and replace them * @param string[] $persistentAction Rich actions for Channels Messages. * @param bool $shortenUrls Sets whether to shorten and track links included in * the body of this message. * @param string $scheduleType Pass the value `fixed` to schedule a message at * a fixed time. * @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 will deliver the message as a * single MMS message, regardless of the presence of * media. * @param string $contentSid The SID of the preconfigured Content object you * want to associate with the message. * @param string $contentVariables Key-value pairs of variable names to * substitution values, used alongside a * content_sid. */ public function __construct(string $from = Values::NONE, string $messagingServiceSid = Values::NONE, string $body = Values::NONE, array $mediaUrl = Values::ARRAY_NONE, string $statusCallback = Values::NONE, string $applicationSid = Values::NONE, string $maxPrice = Values::NONE, bool $provideFeedback = Values::NONE, int $attempt = Values::NONE, int $validityPeriod = Values::NONE, bool $forceDelivery = Values::NONE, string $contentRetention = Values::NONE, string $addressRetention = Values::NONE, bool $smartEncoded = Values::NONE, array $persistentAction = Values::ARRAY_NONE, bool $shortenUrls = Values::NONE, string $scheduleType = Values::NONE, \DateTime $sendAt = Values::NONE, bool $sendAsMms = Values::NONE, string $contentSid = Values::NONE, string $contentVariables = Values::NONE) { $this->options['from'] = $from; $this->options['messagingServiceSid'] = $messagingServiceSid; $this->options['body'] = $body; $this->options['mediaUrl'] = $mediaUrl; $this->options['statusCallback'] = $statusCallback; $this->options['applicationSid'] = $applicationSid; $this->options['maxPrice'] = $maxPrice; $this->options['provideFeedback'] = $provideFeedback; $this->options['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['contentSid'] = $contentSid; $this->options['contentVariables'] = $contentVariables; } /** * A Twilio phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, an [alphanumeric sender ID](https://www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), or a [Channel Endpoint address](https://www.twilio.com/docs/sms/channels#channel-addresses) that is enabled for the type of message you want to send. Phone numbers or [short codes](https://www.twilio.com/docs/sms/api/short-code) purchased from Twilio also work here. You cannot, for example, spoof messages from a private cell phone number. If you are using `messaging_service_sid`, this parameter must be empty. * * @param string $from The phone number that initiated the message * @return $this Fluent Builder */ public function setFrom(string $from): self { $this->options['from'] = $from; return $this; } /** * The SID of the [Messaging Service](https://www.twilio.com/docs/sms/services#send-a-message-with-copilot) you want to associate with the Message. Set this parameter to use the [Messaging Service Settings and Copilot Features](https://www.twilio.com/console/sms/services) you have configured and leave the `from` parameter empty. When only this parameter is set, Twilio will use your enabled Copilot Features to select the `from` phone number for delivery. * * @param string $messagingServiceSid The SID of the Messaging Service you want * to associate with the message. * @return $this Fluent Builder */ public function setMessagingServiceSid(string $messagingServiceSid): self { $this->options['messagingServiceSid'] = $messagingServiceSid; return $this; } /** * The text of the message you want to send. Can be up to 1,600 characters in length. * * @param string $body The text of the message you want to send. Can be up to * 1,600 characters in length. * @return $this Fluent Builder */ public function setBody(string $body): self { $this->options['body'] = $body; return $this; } /** * The URL of the media to send with the message. The media can be of type `gif`, `png`, and `jpeg` and will be formatted correctly on the recipient's device. The media size limit is 5MB for supported file types (JPEG, PNG, GIF) and 500KB for [other types](https://www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message body, provide multiple `media_url` parameters in the POST request. You can include up to 10 `media_url` parameters per message. You can send images in an SMS message in only the US and Canada. * * @param string[] $mediaUrl The URL of the media to send with the message * @return $this Fluent Builder */ public function setMediaUrl(array $mediaUrl): self { $this->options['mediaUrl'] = $mediaUrl; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application. If specified, we POST these message status changes to the URL: `queued`, `failed`, `sent`, `delivered`, or `undelivered`. Twilio will POST its [standard request parameters](https://www.twilio.com/docs/sms/twiml#request-parameters) as well as some additional parameters including `MessageSid`, `MessageStatus`, and `ErrorCode`. If you include this parameter with the `messaging_service_sid`, we use this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/sms/services/api). URLs must contain a valid hostname and underscores are not allowed. * * @param string $statusCallback The URL we should call to send status * information to your application * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The SID of the application that should receive message status. We POST a `message_sid` parameter and a `message_status` parameter with a value of `sent` or `failed` to the [application](https://www.twilio.com/docs/usage/api/applications)'s `message_status_callback`. If a `status_callback` parameter is also passed, it will be ignored and the application's `message_status_callback` parameter will be used. * * @param string $applicationSid The application to use for callbacks * @return $this Fluent Builder */ public function setApplicationSid(string $applicationSid): self { $this->options['applicationSid'] = $applicationSid; return $this; } /** * The maximum total price in US dollars that you will pay for the message to be delivered. Can be a decimal value that has up to 4 decimal places. All messages are queued for delivery and the message cost is checked before the message is sent. If the cost exceeds `max_price`, the message will fail and a status of `Failed` is sent to the status callback. If `MaxPrice` is not set, the message cost is not checked. * * @param string $maxPrice The total maximum price up to 4 decimal places in US * dollars acceptable for the message to be delivered. * @return $this Fluent Builder */ public function setMaxPrice(string $maxPrice): self { $this->options['maxPrice'] = $maxPrice; return $this; } /** * Whether to confirm delivery of the message. Set this value to `true` if you are sending messages that have a trackable user action and you intend to confirm delivery of the message using the [Message Feedback API](https://www.twilio.com/docs/sms/api/message-feedback-resource). This parameter is `false` by default. * * @param bool $provideFeedback Whether to confirm delivery of the message * @return $this Fluent Builder */ public function setProvideFeedback(bool $provideFeedback): self { $this->options['provideFeedback'] = $provideFeedback; return $this; } /** * Total number of attempts made ( including this ) to send out the message regardless of the provider used * * @param int $attempt Total numer of attempts made , this inclusive to send * out the message * @return $this Fluent Builder */ public function setAttempt(int $attempt): self { $this->options['attempt'] = $attempt; return $this; } /** * How long in seconds the message can remain in our outgoing message queue. After this period elapses, the message fails and we call your status callback. Can be between 1 and the default value of 14,400 seconds. After a message has been accepted by a carrier, however, we cannot guarantee that the message will not be queued after this period. We recommend that this value be at least 5 seconds. * * @param int $validityPeriod The number of seconds that the message can remain * in our outgoing queue. * @return $this Fluent Builder */ public function setValidityPeriod(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; } /** * Determines if the message content can be stored or redacted based on privacy settings * * @param string $contentRetention Determines if the message content can be * stored or redacted based on privacy settings * @return $this Fluent Builder */ public function setContentRetention(string $contentRetention): self { $this->options['contentRetention'] = $contentRetention; return $this; } /** * Determines if the address can be stored or obfuscated based on privacy settings * * @param string $addressRetention Determines if the address can be stored or * obfuscated based on privacy settings * @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 * @return $this Fluent Builder */ public function setSmartEncoded(bool $smartEncoded): self { $this->options['smartEncoded'] = $smartEncoded; return $this; } /** * Rich actions for Channels Messages. * * @param string[] $persistentAction Rich actions for Channels Messages. * @return $this Fluent Builder */ public function setPersistentAction(array $persistentAction): self { $this->options['persistentAction'] = $persistentAction; return $this; } /** * Determines the usage of Click Tracking. Setting it to `true` will instruct Twilio to replace all links in the Message with a shortened version based on the associated Domain Sid and track clicks on them. If this parameter is not set on an API call, we will use the value set on the Messaging Service. If this parameter is not set and the value is not configured on the Messaging Service used this will default to `false`. * * @param bool $shortenUrls Sets whether to shorten and track links included in * the body of this message. * @return $this Fluent Builder */ public function setShortenUrls(bool $shortenUrls): self { $this->options['shortenUrls'] = $shortenUrls; return $this; } /** * Indicates your intent to schedule a message. Pass the value `fixed` to schedule a message at a fixed time. * * @param string $scheduleType Pass the value `fixed` to schedule a message at * a fixed time. * @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 will deliver the message as a single MMS message, regardless of the presence of media. * * @param bool $sendAsMms If set to True, Twilio will deliver 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; } /** * The SID of the Content object returned at Content API content create time (https://www.twilio.com/docs/content-api/create-and-send-your-first-content-api-template#create-a-template). If this parameter is not specified, then the Content API will not be utilized. * * @param string $contentSid The SID of the preconfigured Content object you * want to associate with the message. * @return $this Fluent Builder */ public function setContentSid(string $contentSid): self { $this->options['contentSid'] = $contentSid; return $this; } /** * Key-value pairs of variable names to substitution values, used alongside a content_sid. If not specified, Content API will default to the default variables defined at create time. * * @param string $contentVariables Key-value pairs of variable names to * substitution values, used alongside a * content_sid. * @return $this Fluent Builder */ public function setContentVariables(string $contentVariables): self { $this->options['contentVariables'] = $contentVariables; return $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 messages sent to this number * @param string $from Filter by from number * @param string $dateSentBefore Filter by date sent * @param string $dateSent Filter by date sent * @param string $dateSentAfter Filter by date sent */ public function __construct(string $to = Values::NONE, string $from = Values::NONE, string $dateSentBefore = Values::NONE, string $dateSent = Values::NONE, string $dateSentAfter = Values::NONE) { $this->options['to'] = $to; $this->options['from'] = $from; $this->options['dateSentBefore'] = $dateSentBefore; $this->options['dateSent'] = $dateSent; $this->options['dateSentAfter'] = $dateSentAfter; } /** * Read messages sent to only this phone number. * * @param string $to Filter by messages sent to this number * @return $this Fluent Builder */ public function setTo(string $to): self { $this->options['to'] = $to; return $this; } /** * Read messages sent from only this phone number or alphanumeric sender ID. * * @param string $from Filter by from number * @return $this Fluent Builder */ public function setFrom(string $from): self { $this->options['from'] = $from; return $this; } /** * The date of the messages to show. Specify a date as `YYYY-MM-DD` in GMT to read only messages sent on this date. For example: `2009-07-06`. You can also specify an inequality, such as `DateSent<=YYYY-MM-DD`, to read messages sent on or before midnight on a date, and `DateSent>=YYYY-MM-DD` to read messages sent on or after midnight on a date. * * @param string $dateSentBefore Filter by date sent * @return $this Fluent Builder */ public function setDateSentBefore(string $dateSentBefore): self { $this->options['dateSentBefore'] = $dateSentBefore; return $this; } /** * The date of the messages to show. Specify a date as `YYYY-MM-DD` in GMT to read only messages sent on this date. For example: `2009-07-06`. You can also specify an inequality, such as `DateSent<=YYYY-MM-DD`, to read messages sent on or before midnight on a date, and `DateSent>=YYYY-MM-DD` to read messages sent on or after midnight on a date. * * @param string $dateSent Filter by date sent * @return $this Fluent Builder */ public function setDateSent(string $dateSent): self { $this->options['dateSent'] = $dateSent; return $this; } /** * The date of the messages to show. Specify a date as `YYYY-MM-DD` in GMT to read only messages sent on this date. For example: `2009-07-06`. You can also specify an inequality, such as `DateSent<=YYYY-MM-DD`, to read messages sent on or before midnight on a date, and `DateSent>=YYYY-MM-DD` to read messages sent on or after midnight on a date. * * @param string $dateSentAfter Filter by date sent * @return $this Fluent Builder */ public function setDateSentAfter(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 text of the message you want to send * @param string $status Set as `canceled` to cancel a message from being sent. */ public function __construct(string $body = Values::NONE, string $status = Values::NONE) { $this->options['body'] = $body; $this->options['status'] = $status; } /** * The text of the message you want to send. Can be up to 1,600 characters long. * * @param string $body The text of the message you want to send * @return $this Fluent Builder */ public function setBody(string $body): self { $this->options['body'] = $body; return $this; } /** * When set as `canceled`, allows a message cancelation request if a message has not yet been sent. * * @param string $status Set as `canceled` to cancel a message from being sent. * @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 . ']'; } } Api/V2010/Account/SigningKeyOptions.php 0000644 00000002550 15107452331 0013520 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class SigningKeyOptions { /** * @param string $friendlyName The friendly_name * @return UpdateSigningKeyOptions Options builder */ public static function update(string $friendlyName = Values::NONE): UpdateSigningKeyOptions { return new UpdateSigningKeyOptions($friendlyName); } } class UpdateSigningKeyOptions extends Options { /** * @param string $friendlyName The friendly_name */ public function __construct(string $friendlyName = Values::NONE) { $this->options['friendlyName'] = $friendlyName; } /** * The friendly_name * * @param string $friendlyName The 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.Api.V2010.UpdateSigningKeyOptions ' . $options . ']'; } } Api/V2010/Account/OutgoingCallerIdContext.php 0000644 00000005535 15107452331 0014643 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class OutgoingCallerIdContext extends InstanceContext { /** * Initialize the OutgoingCallerIdContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/OutgoingCallerIds/' . \rawurlencode($sid) . '.json'; } /** * Fetch the OutgoingCallerIdInstance * * @return OutgoingCallerIdInstance Fetched OutgoingCallerIdInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): OutgoingCallerIdInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new OutgoingCallerIdInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Delete the OutgoingCallerIdInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Api/V2010/Account/AvailablePhoneNumberCountryContext.php 0000644 00000015357 15107452331 0017062 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\LocalList; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\MachineToMachineList; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\MobileList; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\NationalList; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\SharedCostList; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\TollFreeList; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\VoipList; use Twilio\Values; use Twilio\Version; /** * @property LocalList $local * @property TollFreeList $tollFree * @property MobileList $mobile * @property NationalList $national * @property VoipList $voip * @property SharedCostList $sharedCost * @property MachineToMachineList $machineToMachine */ class AvailablePhoneNumberCountryContext extends InstanceContext { protected $_local; protected $_tollFree; protected $_mobile; protected $_national; protected $_voip; protected $_sharedCost; protected $_machineToMachine; /** * Initialize the AvailablePhoneNumberCountryContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account requesting the available * phone number Country resource * @param string $countryCode The ISO country code of the country to fetch * available phone number information about */ public function __construct(Version $version, $accountSid, $countryCode) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); return new AvailablePhoneNumberCountryInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['countryCode'] ); } /** * 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; } /** * 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 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 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 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 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 machineToMachine */ protected function getMachineToMachine(): MachineToMachineList { if (!$this->_machineToMachine) { $this->_machineToMachine = new MachineToMachineList( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->_machineToMachine; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return 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) . ']'; } } Api/V2010/Account/UsageInstance.php 0000644 00000003120 15107452331 0012620 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; class UsageInstance extends InstanceResource { /** * Initialize the UsageInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); $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.UsageInstance]'; } } Api/V2010/Account/TokenList.php 0000644 00000003057 15107452331 0012014 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class TokenList extends ListResource { /** * Construct the TokenList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); 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]'; } } Api/V2010/Account/BalanceInstance.php 0000644 00000003575 15107452331 0013117 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $balance * @property string $currency */ class BalanceInstance extends InstanceResource { /** * Initialize the BalanceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid Account Sid. */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Api/V2010/Account/TokenOptions.php 0000644 00000002610 15107452331 0012526 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class TokenOptions { /** * @param int $ttl The duration in seconds the credentials are valid * @return CreateTokenOptions Options builder */ public static function create(int $ttl = Values::NONE): CreateTokenOptions { return new CreateTokenOptions($ttl); } } class CreateTokenOptions extends Options { /** * @param int $ttl The duration in seconds the credentials are valid */ public function __construct(int $ttl = Values::NONE) { $this->options['ttl'] = $ttl; } /** * The duration in seconds for which the generated credentials are valid. The default value is 86400 (24 hours). * * @param int $ttl The duration in seconds the credentials are valid * @return $this Fluent Builder */ public function setTtl(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 . ']'; } } Api/V2010/Account/TranscriptionPage.php 0000644 00000002314 15107452331 0013527 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class TranscriptionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/TokenPage.php 0000644 00000002234 15107452331 0011751 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class TokenPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/ShortCodePage.php 0000644 00000002264 15107452331 0012566 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ShortCodePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/MessagePage.php 0000644 00000002250 15107452331 0012253 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MessagePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/CallOptions.php 0000644 00000142721 15107452331 0012331 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class CallOptions { /** * @param string $url The absolute URL that returns TwiML for this call * @param string $twiml TwiML instructions for the call * @param string $applicationSid The SID of the Application resource that will * handle the call * @param string $method HTTP method to use to fetch TwiML * @param string $fallbackUrl Fallback URL in case of error * @param string $fallbackMethod HTTP Method to use with fallback_url * @param string $statusCallback The URL we should call to send status * information to your application * @param string[] $statusCallbackEvent The call progress events that we send * to the `status_callback` URL. * @param string $statusCallbackMethod HTTP Method to use with status_callback * @param string $sendDigits The digits to dial after connecting to the number * @param int $timeout Number of seconds to wait for an answer * @param bool $record Whether to record the call * @param string $recordingChannels The number of channels in the final * recording * @param string $recordingStatusCallback The URL that we call when the * recording is available to be accessed * @param string $recordingStatusCallbackMethod The HTTP method we should use * when calling the * `recording_status_callback` URL * @param string $sipAuthUsername The username used to authenticate the caller * making a SIP call * @param string $sipAuthPassword The password required to authenticate the * user account specified in `sip_auth_username`. * @param string $machineDetection Enable machine detection or end of greeting * detection * @param int $machineDetectionTimeout Number of seconds to wait for machine * detection * @param string[] $recordingStatusCallbackEvent The recording status events * that will trigger calls to the * URL specified in * `recording_status_callback` * @param string $trim Set this parameter to control trimming of silence on the * recording. * @param string $callerId The phone number, SIP address, or Client identifier * that made this call. Phone numbers are in E.164 * format (e.g., +16175551212). SIP addresses are * formatted as `name@company.com`. * @param int $machineDetectionSpeechThreshold Number of milliseconds for * measuring stick for the length * of the speech activity * @param int $machineDetectionSpeechEndThreshold Number of milliseconds of * silence after speech activity * @param int $machineDetectionSilenceTimeout Number of milliseconds of initial * silence * @param string $asyncAmd Enable asynchronous AMD * @param string $asyncAmdStatusCallback The URL we should call to send amd * status information to your application * @param string $asyncAmdStatusCallbackMethod HTTP Method to use with * async_amd_status_callback * @param string $byoc BYOC trunk SID (Beta) * @param string $callReason Reason for the call (Branded Calls Beta) * @param string $callToken A token string needed to invoke a forwarded call * with a CallerId recieved on a previous incoming call * @param string $recordingTrack Which track(s) to record * @param int $timeLimit The maximum duration of the call in seconds. * @return CreateCallOptions Options builder */ public static function create(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::NONE, bool $record = Values::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::NONE, array $recordingStatusCallbackEvent = Values::ARRAY_NONE, string $trim = Values::NONE, string $callerId = Values::NONE, int $machineDetectionSpeechThreshold = Values::NONE, int $machineDetectionSpeechEndThreshold = Values::NONE, int $machineDetectionSilenceTimeout = Values::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::NONE): CreateCallOptions { return new CreateCallOptions($url, $twiml, $applicationSid, $method, $fallbackUrl, $fallbackMethod, $statusCallback, $statusCallbackEvent, $statusCallbackMethod, $sendDigits, $timeout, $record, $recordingChannels, $recordingStatusCallback, $recordingStatusCallbackMethod, $sipAuthUsername, $sipAuthPassword, $machineDetection, $machineDetectionTimeout, $recordingStatusCallbackEvent, $trim, $callerId, $machineDetectionSpeechThreshold, $machineDetectionSpeechEndThreshold, $machineDetectionSilenceTimeout, $asyncAmd, $asyncAmdStatusCallback, $asyncAmdStatusCallbackMethod, $byoc, $callReason, $callToken, $recordingTrack, $timeLimit); } /** * @param string $to Phone number or Client identifier of calls to include * @param string $from Phone number or Client identifier to filter `from` on * @param string $parentCallSid Parent call SID to filter on * @param string $status The status of the resources to read * @param string $startTimeBefore Only include calls that started on this date * @param string $startTime Only include calls that started on this date * @param string $startTimeAfter Only include calls that started on this date * @param string $endTimeBefore Only include calls that ended on this date * @param string $endTime Only include calls that ended on this date * @param string $endTimeAfter Only include calls that ended on this date * @return ReadCallOptions Options builder */ public static function read(string $to = Values::NONE, string $from = Values::NONE, string $parentCallSid = Values::NONE, string $status = Values::NONE, string $startTimeBefore = Values::NONE, string $startTime = Values::NONE, string $startTimeAfter = Values::NONE, string $endTimeBefore = Values::NONE, string $endTime = Values::NONE, string $endTimeAfter = Values::NONE): ReadCallOptions { return new ReadCallOptions($to, $from, $parentCallSid, $status, $startTimeBefore, $startTime, $startTimeAfter, $endTimeBefore, $endTime, $endTimeAfter); } /** * @param string $url The absolute URL that returns TwiML for this call * @param string $method HTTP method to use to fetch TwiML * @param string $status The new status to update the call with. * @param string $fallbackUrl Fallback URL in case of error * @param string $fallbackMethod HTTP Method to use with fallback_url * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod HTTP Method to use to call * status_callback * @param string $twiml TwiML instructions for the call * @param int $timeLimit The maximum duration of the call in seconds. * @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::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 TwiML for this call * @param string $twiml TwiML instructions for the call * @param string $applicationSid The SID of the Application resource that will * handle the call * @param string $method HTTP method to use to fetch TwiML * @param string $fallbackUrl Fallback URL in case of error * @param string $fallbackMethod HTTP Method to use with fallback_url * @param string $statusCallback The URL we should call to send status * information to your application * @param string[] $statusCallbackEvent The call progress events that we send * to the `status_callback` URL. * @param string $statusCallbackMethod HTTP Method to use with status_callback * @param string $sendDigits The digits to dial after connecting to the number * @param int $timeout Number of seconds to wait for an answer * @param bool $record Whether to record the call * @param string $recordingChannels The number of channels in the final * recording * @param string $recordingStatusCallback The URL that we call when the * recording is available to be accessed * @param string $recordingStatusCallbackMethod The HTTP method we should use * when calling the * `recording_status_callback` URL * @param string $sipAuthUsername The username used to authenticate the caller * making a SIP call * @param string $sipAuthPassword The password required to authenticate the * user account specified in `sip_auth_username`. * @param string $machineDetection Enable machine detection or end of greeting * detection * @param int $machineDetectionTimeout Number of seconds to wait for machine * detection * @param string[] $recordingStatusCallbackEvent The recording status events * that will trigger calls to the * URL specified in * `recording_status_callback` * @param string $trim Set this parameter to control trimming of silence on the * recording. * @param string $callerId The phone number, SIP address, or Client identifier * that made this call. Phone numbers are in E.164 * format (e.g., +16175551212). SIP addresses are * formatted as `name@company.com`. * @param int $machineDetectionSpeechThreshold Number of milliseconds for * measuring stick for the length * of the speech activity * @param int $machineDetectionSpeechEndThreshold Number of milliseconds of * silence after speech activity * @param int $machineDetectionSilenceTimeout Number of milliseconds of initial * silence * @param string $asyncAmd Enable asynchronous AMD * @param string $asyncAmdStatusCallback The URL we should call to send amd * status information to your application * @param string $asyncAmdStatusCallbackMethod HTTP Method to use with * async_amd_status_callback * @param string $byoc BYOC trunk SID (Beta) * @param string $callReason Reason for the call (Branded Calls Beta) * @param string $callToken A token string needed to invoke a forwarded call * with a CallerId recieved on a previous incoming call * @param string $recordingTrack Which track(s) to record * @param int $timeLimit The maximum duration of the call in seconds. */ 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::NONE, bool $record = Values::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::NONE, array $recordingStatusCallbackEvent = Values::ARRAY_NONE, string $trim = Values::NONE, string $callerId = Values::NONE, int $machineDetectionSpeechThreshold = Values::NONE, int $machineDetectionSpeechEndThreshold = Values::NONE, int $machineDetectionSilenceTimeout = Values::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::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 TwiML for this call * @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 * @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 * @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 HTTP method to use to fetch TwiML * @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 Fallback URL in case of error * @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 HTTP Method to use with fallback_url * @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 to send status * information to your application * @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 send * to the `status_callback` URL. * @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 HTTP Method to use with status_callback * @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 The digits to dial after connecting to the number * @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 Number of seconds to wait for an answer * @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 * @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 * @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 * @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 Enable machine detection or end of greeting * 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 Number of seconds to wait for machine * detection * @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` * @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 Set this parameter to control trimming of silence on the * recording. * @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 (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 Number of milliseconds for * measuring stick for the length * of the speech activity * @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 Number of milliseconds of * silence after speech activity * @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 Number of milliseconds of initial * silence * @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 Enable asynchronous AMD * @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 we should call to send amd * status information to your application * @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 HTTP Method to use with * async_amd_status_callback * @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 BYOC trunk SID (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 Reason for the call (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 * with a CallerId recieved on a previous 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 Which track(s) to record * @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. * @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 Phone number or Client identifier of calls to include * @param string $from Phone number or Client identifier to filter `from` on * @param string $parentCallSid Parent call SID to filter on * @param string $status The status of the resources to read * @param string $startTimeBefore Only include calls that started on this date * @param string $startTime Only include calls that started on this date * @param string $startTimeAfter Only include calls that started on this date * @param string $endTimeBefore Only include calls that ended on this date * @param string $endTime Only include calls that ended on this date * @param string $endTimeAfter Only include calls that ended on this date */ public function __construct(string $to = Values::NONE, string $from = Values::NONE, string $parentCallSid = Values::NONE, string $status = Values::NONE, string $startTimeBefore = Values::NONE, string $startTime = Values::NONE, string $startTimeAfter = Values::NONE, string $endTimeBefore = Values::NONE, string $endTime = Values::NONE, string $endTimeAfter = Values::NONE) { $this->options['to'] = $to; $this->options['from'] = $from; $this->options['parentCallSid'] = $parentCallSid; $this->options['status'] = $status; $this->options['startTimeBefore'] = $startTimeBefore; $this->options['startTime'] = $startTime; $this->options['startTimeAfter'] = $startTimeAfter; $this->options['endTimeBefore'] = $endTimeBefore; $this->options['endTime'] = $endTime; $this->options['endTimeAfter'] = $endTimeAfter; } /** * Only show calls made to this phone number, SIP address, Client identifier or SIM SID. * * @param string $to Phone number or Client identifier of calls to include * @return $this Fluent Builder */ public function setTo(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 Phone number or Client identifier to filter `from` on * @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 Parent call SID to filter on * @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 resources to read * @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 GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. * * @param string $startTimeBefore Only include calls that started on this date * @return $this Fluent Builder */ public function setStartTimeBefore(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 GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. * * @param string $startTime Only include calls that started on this date * @return $this Fluent Builder */ public function setStartTime(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 GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. * * @param string $startTimeAfter Only include calls that started on this date * @return $this Fluent Builder */ public function setStartTimeAfter(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 GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. * * @param string $endTimeBefore Only include calls that ended on this date * @return $this Fluent Builder */ public function setEndTimeBefore(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 GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. * * @param string $endTime Only include calls that ended on this date * @return $this Fluent Builder */ public function setEndTime(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 GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. * * @param string $endTimeAfter Only include calls that ended on this date * @return $this Fluent Builder */ public function setEndTimeAfter(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 TwiML for this call * @param string $method HTTP method to use to fetch TwiML * @param string $status The new status to update the call with. * @param string $fallbackUrl Fallback URL in case of error * @param string $fallbackMethod HTTP Method to use with fallback_url * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod HTTP Method to use to call * status_callback * @param string $twiml TwiML instructions for the call * @param int $timeLimit The maximum duration of the call in seconds. */ 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::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 TwiML for this call * @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 HTTP method to use to fetch TwiML * @return $this Fluent Builder */ public function setMethod(string $method): self { $this->options['method'] = $method; return $this; } /** * The new status of the resource. Can be: `canceled` or `completed`. Specifying `canceled` will attempt to hang up calls that are queued or ringing; however, it will not affect calls already in progress. Specifying `completed` will attempt to hang up a call even if it's already in progress. * * @param string $status The new status to update the call with. * @return $this Fluent Builder */ public function setStatus(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 Fallback URL in case of error * @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 HTTP Method to use with fallback_url * @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 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 when requesting the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * * @param string $statusCallbackMethod HTTP Method to use to call * status_callback * @return $this Fluent Builder */ public function setStatusCallbackMethod(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 * @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. * @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 . ']'; } } Api/V2010/Account/MessageList.php 0000644 00000016704 15107452332 0012324 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class MessageList extends ListResource { /** * Construct the MessageList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Messages.json'; } /** * Create the MessageInstance * * @param string $to The destination phone number * @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, 'From' => $options['from'], 'MessagingServiceSid' => $options['messagingServiceSid'], 'Body' => $options['body'], 'MediaUrl' => Serialize::map($options['mediaUrl'], function($e) { return $e; }), 'StatusCallback' => $options['statusCallback'], 'ApplicationSid' => $options['applicationSid'], 'MaxPrice' => $options['maxPrice'], 'ProvideFeedback' => Serialize::booleanToString($options['provideFeedback']), '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']), 'ContentSid' => $options['contentSid'], 'ContentVariables' => $options['contentVariables'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new MessageInstance($this->version, $payload, $this->solution['accountSid']); } /** * Streams MessageInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of MessageInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 unique string that identifies the resource */ 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]'; } } Api/V2010/Account/CallPage.php 0000644 00000002226 15107452332 0011546 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CallPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/OutgoingCallerIdPage.php 0000644 00000002336 15107452332 0014070 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class OutgoingCallerIdPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/RecordingInstance.php 0000644 00000013053 15107452332 0013477 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Api\V2010\Account\Recording\AddOnResultList; use Twilio\Rest\Api\V2010\Account\Recording\TranscriptionList; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property string $callSid * @property string $conferenceSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property \DateTime $startTime * @property string $duration * @property string $sid * @property string $price * @property string $priceUnit * @property string $status * @property int $channels * @property string $source * @property int $errorCode * @property string $uri * @property array $encryptionDetails * @property array $subresourceUris * @property string $mediaUrl */ class RecordingInstance extends InstanceResource { protected $_transcriptions; protected $_addOnResults; /** * Initialize the RecordingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Access the transcriptions */ protected function getTranscriptions(): TranscriptionList { return $this->proxy()->transcriptions; } /** * Access the addOnResults */ protected function getAddOnResults(): AddOnResultList { return $this->proxy()->addOnResults; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Api/V2010/Account/ConferenceContext.php 0000644 00000011661 15107452332 0013515 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Api\V2010\Account\Conference\ParticipantList; use Twilio\Rest\Api\V2010\Account\Conference\RecordingList; use Twilio\Values; use Twilio\Version; /** * @property ParticipantList $participants * @property RecordingList $recordings * @method \Twilio\Rest\Api\V2010\Account\Conference\ParticipantContext participants(string $callSid) * @method \Twilio\Rest\Api\V2010\Account\Conference\RecordingContext recordings(string $sid) */ class ConferenceContext extends InstanceContext { protected $_participants; protected $_recordings; /** * Initialize the ConferenceContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the * resource(s) to fetch * @param string $sid The unique string that identifies this resource */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } Api/V2010/Account/IncomingPhoneNumberInstance.php 0000644 00000017117 15107452332 0015476 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOnList; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $addressSid * @property string $addressRequirements * @property string $apiVersion * @property bool $beta * @property string $capabilities * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $identitySid * @property string $phoneNumber * @property string $origin * @property string $sid * @property string $smsApplicationSid * @property string $smsFallbackMethod * @property string $smsFallbackUrl * @property string $smsMethod * @property string $smsUrl * @property string $statusCallback * @property string $statusCallbackMethod * @property string $trunkSid * @property string $uri * @property string $voiceReceiveMode * @property string $voiceApplicationSid * @property bool $voiceCallerIdLookup * @property string $voiceFallbackMethod * @property string $voiceFallbackUrl * @property string $voiceMethod * @property string $voiceUrl * @property string $emergencyStatus * @property string $emergencyAddressSid * @property string $emergencyAddressStatus * @property string $bundleSid * @property string $status */ class IncomingPhoneNumberInstance extends InstanceResource { protected $_assignedAddOns; /** * Initialize the IncomingPhoneNumberInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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' => 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; } /** * 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); } /** * Fetch the IncomingPhoneNumberInstance * * @return IncomingPhoneNumberInstance Fetched IncomingPhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): IncomingPhoneNumberInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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) . ']'; } } Api/V2010/Account/ValidationRequestOptions.php 0000644 00000012047 15107452332 0015117 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class ValidationRequestOptions { /** * @param string $friendlyName A string to describe the resource * @param int $callDelay The number of seconds to delay before initiating the * verification call * @param string $extension The digits to dial after connecting the * verification call * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @return CreateValidationRequestOptions Options builder */ public static function create(string $friendlyName = Values::NONE, int $callDelay = Values::NONE, string $extension = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE): CreateValidationRequestOptions { return new CreateValidationRequestOptions($friendlyName, $callDelay, $extension, $statusCallback, $statusCallbackMethod); } } class CreateValidationRequestOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param int $callDelay The number of seconds to delay before initiating the * verification call * @param string $extension The digits to dial after connecting the * verification call * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback */ public function __construct(string $friendlyName = Values::NONE, int $callDelay = Values::NONE, string $extension = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['callDelay'] = $callDelay; $this->options['extension'] = $extension; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; } /** * A descriptive string that you create to describe the new caller ID resource. It can be up to 64 characters long. The default value is a formatted version of the phone number. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName(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 * @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 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 the default is `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @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 . ']'; } } Api/V2010/Account/KeyList.php 0000644 00000011265 15107452332 0011465 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class KeyList extends ListResource { /** * Construct the KeyList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Keys.json'; } /** * Streams KeyInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 unique string that identifies the resource */ 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]'; } } Api/V2010/Account/NotificationInstance.php 0000644 00000011106 15107452332 0014206 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property string $callSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $errorCode * @property string $log * @property \DateTime $messageDate * @property string $messageText * @property string $moreInfo * @property string $requestMethod * @property string $requestUrl * @property string $requestVariables * @property string $responseBody * @property string $responseHeaders * @property string $sid * @property string $uri */ class NotificationInstance extends InstanceResource { /** * Initialize the NotificationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Api/V2010/Account/AuthorizedConnectAppPage.php 0000644 00000002366 15107452332 0014771 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AuthorizedConnectAppPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/NotificationOptions.php 0000644 00000007366 15107452332 0014112 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class NotificationOptions { /** * @param int $log Filter by log level * @param string $messageDateBefore Filter by date * @param string $messageDate Filter by date * @param string $messageDateAfter Filter by date * @return ReadNotificationOptions Options builder */ public static function read(int $log = Values::NONE, string $messageDateBefore = Values::NONE, string $messageDate = Values::NONE, string $messageDateAfter = Values::NONE): ReadNotificationOptions { return new ReadNotificationOptions($log, $messageDateBefore, $messageDate, $messageDateAfter); } } class ReadNotificationOptions extends Options { /** * @param int $log Filter by log level * @param string $messageDateBefore Filter by date * @param string $messageDate Filter by date * @param string $messageDateAfter Filter by date */ public function __construct(int $log = Values::NONE, string $messageDateBefore = Values::NONE, string $messageDate = Values::NONE, string $messageDateAfter = Values::NONE) { $this->options['log'] = $log; $this->options['messageDateBefore'] = $messageDateBefore; $this->options['messageDate'] = $messageDate; $this->options['messageDateAfter'] = $messageDateAfter; } /** * Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read. * * @param int $log Filter by log level * @return $this Fluent Builder */ public function setLog(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 Filter by 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 Filter by 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 Filter by 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 . ']'; } } Api/V2010/Account/AddressPage.php 0000644 00000002250 15107452332 0012255 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AddressPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/NewSigningKeyInstance.php 0000644 00000004367 15107452332 0014314 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $secret */ class NewSigningKeyInstance extends InstanceResource { /** * Initialize the NewSigningKeyInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Api/V2010/Account/AddressInstance.php 0000644 00000012477 15107452332 0013161 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Api\V2010\Account\Address\DependentPhoneNumberList; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $city * @property string $customerName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $isoCountry * @property string $postalCode * @property string $region * @property string $sid * @property string $street * @property string $uri * @property bool $emergencyEnabled * @property bool $validated * @property bool $verified * @property string $streetSecondary */ class AddressInstance extends InstanceResource { protected $_dependentPhoneNumbers; /** * Initialize the AddressInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that is responsible for the * resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Api/V2010/Account/SigningKeyInstance.php 0000644 00000007550 15107452332 0013637 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated */ class SigningKeyInstance extends InstanceResource { /** * Initialize the SigningKeyInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @param string $sid The sid */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Api/V2010/Account/MessageContext.php 0000644 00000011536 15107452332 0013033 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Api\V2010\Account\Message\FeedbackList; use Twilio\Rest\Api\V2010\Account\Message\MediaList; use Twilio\Values; use Twilio\Version; /** * @property MediaList $media * @property FeedbackList $feedback * @method \Twilio\Rest\Api\V2010\Account\Message\MediaContext media(string $sid) */ class MessageContext extends InstanceContext { protected $_media; protected $_feedback; /** * Initialize the MessageContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->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 { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MessageInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new MessageInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * 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; } /** * 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; } /** * 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) . ']'; } } Api/V2010/Account/ConferencePage.php 0000644 00000002272 15107452332 0012743 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ConferencePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/RecordingPage.php 0000644 00000002264 15107452332 0012611 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RecordingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/ConferenceOptions.php 0000644 00000025550 15107452332 0013526 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class ConferenceOptions { /** * @param string $dateCreatedBefore The `YYYY-MM-DD` value of the resources to * read * @param string $dateCreated The `YYYY-MM-DD` value of the resources to read * @param string $dateCreatedAfter The `YYYY-MM-DD` value of the resources to * read * @param string $dateUpdatedBefore The `YYYY-MM-DD` value of the resources to * read * @param string $dateUpdated The `YYYY-MM-DD` value of the resources to read * @param string $dateUpdatedAfter The `YYYY-MM-DD` value of the resources to * read * @param string $friendlyName The string that identifies the Conference * resources to read * @param string $status The status of the resources to read * @return ReadConferenceOptions Options builder */ public static function read(string $dateCreatedBefore = Values::NONE, string $dateCreated = Values::NONE, string $dateCreatedAfter = Values::NONE, string $dateUpdatedBefore = Values::NONE, string $dateUpdated = Values::NONE, string $dateUpdatedAfter = Values::NONE, string $friendlyName = Values::NONE, string $status = Values::NONE): ReadConferenceOptions { return new ReadConferenceOptions($dateCreatedBefore, $dateCreated, $dateCreatedAfter, $dateUpdatedBefore, $dateUpdated, $dateUpdatedAfter, $friendlyName, $status); } /** * @param string $status The new status of the resource * @param string $announceUrl The URL we should call to announce something into * the conference * @param string $announceMethod he HTTP method used to call announce_url * @return UpdateConferenceOptions Options builder */ public static function update(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 The `YYYY-MM-DD` value of the resources to * read * @param string $dateCreated The `YYYY-MM-DD` value of the resources to read * @param string $dateCreatedAfter The `YYYY-MM-DD` value of the resources to * read * @param string $dateUpdatedBefore The `YYYY-MM-DD` value of the resources to * read * @param string $dateUpdated The `YYYY-MM-DD` value of the resources to read * @param string $dateUpdatedAfter The `YYYY-MM-DD` value of the resources to * read * @param string $friendlyName The string that identifies the Conference * resources to read * @param string $status The status of the resources to read */ public function __construct(string $dateCreatedBefore = Values::NONE, string $dateCreated = Values::NONE, string $dateCreatedAfter = Values::NONE, string $dateUpdatedBefore = Values::NONE, string $dateUpdated = Values::NONE, string $dateUpdatedAfter = Values::NONE, 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; } /** * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. * * @param string $dateCreatedBefore The `YYYY-MM-DD` value of the resources to * read * @return $this Fluent Builder */ public function setDateCreatedBefore(string $dateCreatedBefore): self { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. * * @param string $dateCreated The `YYYY-MM-DD` value of the resources to read * @return $this Fluent Builder */ public function setDateCreated(string $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. * * @param string $dateCreatedAfter The `YYYY-MM-DD` value of the resources to * read * @return $this Fluent Builder */ public function setDateCreatedAfter(string $dateCreatedAfter): self { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. * * @param string $dateUpdatedBefore The `YYYY-MM-DD` value of the resources to * read * @return $this Fluent Builder */ public function setDateUpdatedBefore(string $dateUpdatedBefore): self { $this->options['dateUpdatedBefore'] = $dateUpdatedBefore; return $this; } /** * The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. * * @param string $dateUpdated The `YYYY-MM-DD` value of the resources to read * @return $this Fluent Builder */ public function setDateUpdated(string $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. * * @param string $dateUpdatedAfter The `YYYY-MM-DD` value of the resources to * read * @return $this Fluent Builder */ public function setDateUpdatedAfter(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 * @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 The new status of the resource * @param string $announceUrl The URL we should call to announce something into * the conference * @param string $announceMethod he HTTP method used to call announce_url */ public function __construct(string $status = Values::NONE, string $announceUrl = Values::NONE, string $announceMethod = Values::NONE) { $this->options['status'] = $status; $this->options['announceUrl'] = $announceUrl; $this->options['announceMethod'] = $announceMethod; } /** * The new status of the resource. Can be: Can be: `init`, `in-progress`, or `completed`. Specifying `completed` will end the conference and hang up all participants * * @param string $status The new status of the resource * @return $this Fluent Builder */ public function setStatus(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 `<Play>`, `<Say>`, `<Pause>`, or `<Redirect>` verbs. * * @param string $announceUrl The URL we should call to announce something into * the conference * @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 he HTTP method used to call announce_url * @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 . ']'; } } Api/V2010/Account/OutgoingCallerIdList.php 0000644 00000012537 15107452332 0014133 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class OutgoingCallerIdList extends ListResource { /** * Construct the OutgoingCallerIdList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/OutgoingCallerIds.json'; } /** * Streams OutgoingCallerIdInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of OutgoingCallerIdInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 unique string that identifies the resource */ 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]'; } } Api/V2010/Account/ApplicationInstance.php 0000644 00000013500 15107452332 0014023 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $messageStatusCallback * @property string $sid * @property string $smsFallbackMethod * @property string $smsFallbackUrl * @property string $smsMethod * @property string $smsStatusCallback * @property string $smsUrl * @property string $statusCallback * @property string $statusCallbackMethod * @property string $uri * @property bool $voiceCallerIdLookup * @property string $voiceFallbackMethod * @property string $voiceFallbackUrl * @property string $voiceMethod * @property string $voiceUrl * @property bool $publicApplicationConnectEnabled */ class ApplicationInstance extends InstanceResource { /** * Initialize the ApplicationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Api/V2010/Account/NewSigningKeyPage.php 0000644 00000002314 15107452332 0013412 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class NewSigningKeyPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/MessageInstance.php 0000644 00000013440 15107452332 0013147 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Api\V2010\Account\Message\FeedbackList; use Twilio\Rest\Api\V2010\Account\Message\MediaList; use Twilio\Values; use Twilio\Version; /** * @property string $body * @property string $numSegments * @property string $direction * @property string $from * @property string $to * @property \DateTime $dateUpdated * @property string $price * @property string $errorMessage * @property string $uri * @property string $accountSid * @property string $numMedia * @property string $status * @property string $messagingServiceSid * @property string $sid * @property \DateTime $dateSent * @property \DateTime $dateCreated * @property int $errorCode * @property string $priceUnit * @property string $apiVersion * @property array $subresourceUris */ class MessageInstance extends InstanceResource { protected $_media; protected $_feedback; /** * Initialize the MessageInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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 media */ protected function getMedia(): MediaList { return $this->proxy()->media; } /** * Access the feedback */ protected function getFeedback(): FeedbackList { return $this->proxy()->feedback; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Api/V2010/Account/ShortCodeContext.php 0000644 00000005406 15107452332 0013340 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class ShortCodeContext extends InstanceContext { /** * Initialize the ShortCodeContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the * resource(s) to fetch * @param string $sid The unique string that identifies this resource */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ShortCodeInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.ShortCodeContext ' . \implode(' ', $context) . ']'; } } Api/V2010/Account/NewSigningKeyOptions.php 0000644 00000002773 15107452332 0014202 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class NewSigningKeyOptions { /** * @param string $friendlyName A string to describe the resource * @return CreateNewSigningKeyOptions Options builder */ public static function create(string $friendlyName = Values::NONE): CreateNewSigningKeyOptions { return new CreateNewSigningKeyOptions($friendlyName); } } class CreateNewSigningKeyOptions extends Options { /** * @param string $friendlyName A string to describe the resource */ 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 string to describe the resource * @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 . ']'; } } Api/V2010/Account/OutgoingCallerIdInstance.php 0000644 00000010346 15107452332 0014760 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $accountSid * @property string $phoneNumber * @property string $uri */ class OutgoingCallerIdInstance extends InstanceResource { /** * Initialize the OutgoingCallerIdInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Api/V2010/Account/QueueOptions.php 0000644 00000006364 15107452332 0012545 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class QueueOptions { /** * @param string $friendlyName A string to describe this resource * @param int $maxSize The max number of calls allowed in the queue * @return UpdateQueueOptions Options builder */ public static function update(string $friendlyName = Values::NONE, int $maxSize = Values::NONE): UpdateQueueOptions { return new UpdateQueueOptions($friendlyName, $maxSize); } /** * @param int $maxSize The max number of calls allowed in the queue * @return CreateQueueOptions Options builder */ public static function create(int $maxSize = Values::NONE): CreateQueueOptions { return new CreateQueueOptions($maxSize); } } class UpdateQueueOptions extends Options { /** * @param string $friendlyName A string to describe this resource * @param int $maxSize The max number of calls allowed in the queue */ public function __construct(string $friendlyName = Values::NONE, int $maxSize = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['maxSize'] = $maxSize; } /** * A descriptive string that you created to describe this resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe this resource * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The maximum number of calls allowed to be in the queue. The default is 100. The maximum is 5000. * * @param int $maxSize The max number of calls allowed in the queue * @return $this Fluent Builder */ public function setMaxSize(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 . ']'; } } class CreateQueueOptions extends Options { /** * @param int $maxSize The max number of calls allowed in the queue */ public function __construct(int $maxSize = Values::NONE) { $this->options['maxSize'] = $maxSize; } /** * The maximum number of calls allowed to be in the queue. The default is 100. The maximum is 5000. * * @param int $maxSize The max number of calls allowed in the queue * @return $this Fluent Builder */ public function setMaxSize(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 . ']'; } } Api/V2010/Account/NewSigningKeyList.php 0000644 00000003264 15107452332 0013456 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class NewSigningKeyList extends ListResource { /** * Construct the NewSigningKeyList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); 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]'; } } Api/V2010/Account/OutgoingCallerIdOptions.php 0000644 00000007341 15107452332 0014650 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class OutgoingCallerIdOptions { /** * @param string $friendlyName A string to describe the resource * @return UpdateOutgoingCallerIdOptions Options builder */ public static function update(string $friendlyName = Values::NONE): UpdateOutgoingCallerIdOptions { return new UpdateOutgoingCallerIdOptions($friendlyName); } /** * @param string $phoneNumber The phone number of the OutgoingCallerId * resources to read * @param string $friendlyName The string that identifies the OutgoingCallerId * resources to read * @return ReadOutgoingCallerIdOptions Options builder */ public static function read(string $phoneNumber = Values::NONE, string $friendlyName = Values::NONE): ReadOutgoingCallerIdOptions { return new ReadOutgoingCallerIdOptions($phoneNumber, $friendlyName); } } class UpdateOutgoingCallerIdOptions extends Options { /** * @param string $friendlyName A string to describe the resource */ 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 string to describe the resource * @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 . ']'; } } class ReadOutgoingCallerIdOptions extends Options { /** * @param string $phoneNumber The phone number of the OutgoingCallerId * resources to read * @param string $friendlyName The string that identifies the OutgoingCallerId * resources to read */ public function __construct(string $phoneNumber = Values::NONE, string $friendlyName = Values::NONE) { $this->options['phoneNumber'] = $phoneNumber; $this->options['friendlyName'] = $friendlyName; } /** * The phone number of the OutgoingCallerId resources to read. * * @param string $phoneNumber The phone number of the OutgoingCallerId * resources to read * @return $this Fluent Builder */ public function setPhoneNumber(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 . ']'; } } Api/V2010/Account/ConferenceList.php 0000644 00000013343 15107452332 0013003 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ConferenceList extends ListResource { /** * Construct the ConferenceList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created this resource */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Conferences.json'; } /** * Streams ConferenceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of ConferenceInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 unique string that identifies this resource */ 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]'; } } Api/V2010/Account/Sip/IpAccessControlListPage.php 0000644 00000002370 15107452332 0015315 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class IpAccessControlListPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Sip/CredentialList/CredentialPage.php 0000644 00000002500 15107452332 0016401 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\CredentialList; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CredentialPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Sip/CredentialList/CredentialOptions.php 0000644 00000003133 15107452332 0017163 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\CredentialList; use Twilio\Options; use Twilio\Values; abstract class CredentialOptions { /** * @param string $password The password will not be returned in the response * @return UpdateCredentialOptions Options builder */ public static function update(string $password = Values::NONE): UpdateCredentialOptions { return new UpdateCredentialOptions($password); } } class UpdateCredentialOptions extends Options { /** * @param string $password The password will not be returned in the response */ public function __construct(string $password = Values::NONE) { $this->options['password'] = $password; } /** * The password that the username will use when authenticating SIP requests. The password must be a minimum of 12 characters, contain at least 1 digit, and have mixed case. (eg `IWasAtSignal2018`) * * @param string $password The password will not be returned in the response * @return $this Fluent Builder */ public function setPassword(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 . ']'; } } Api/V2010/Account/Sip/CredentialList/CredentialContext.php 0000644 00000006373 15107452332 0017165 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\CredentialList; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class CredentialContext extends InstanceContext { /** * Initialize the CredentialContext * * @param Version $version Version that contains the resource * @param string $accountSid The unique id of the Account that is responsible * for this resource. * @param string $credentialListSid The unique id that identifies the * credential list that contains the desired * credential * @param string $sid The unique id that identifies the resource to fetch. */ public function __construct(Version $version, $accountSid, $credentialListSid, $sid) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'credentialListSid' => $credentialListSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SIP/CredentialLists/' . \rawurlencode($credentialListSid) . '/Credentials/' . \rawurlencode($sid) . '.json'; } /** * Fetch the CredentialInstance * * @return CredentialInstance Fetched CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new CredentialInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['credentialListSid'], $this->solution['sid'] ); } /** * Delete the CredentialInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Api/V2010/Account/Sip/CredentialList/CredentialList.php 0000644 00000014063 15107452332 0016447 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\CredentialList; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class CredentialList extends ListResource { /** * Construct the CredentialList * * @param Version $version Version that contains the resource * @param string $accountSid The unique id of the Account that is responsible * for this resource. * @param string $credentialListSid The unique id that identifies the * credential list that includes this * credential */ public function __construct(Version $version, string $accountSid, string $credentialListSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'credentialListSid' => $credentialListSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SIP/CredentialLists/' . \rawurlencode($credentialListSid) . '/Credentials.json'; } /** * Streams CredentialInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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); } /** * Create the CredentialInstance * * @param string $username The username for this credential. * @param string $password The password will not be returned in the response. * @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, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CredentialInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['credentialListSid'] ); } /** * Constructs a CredentialContext * * @param string $sid The unique id that identifies the resource to fetch. */ 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]'; } } Api/V2010/Account/Sip/CredentialList/CredentialInstance.php 0000644 00000011112 15107452332 0017270 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\CredentialList; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $credentialListSid * @property string $username * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $uri */ class CredentialInstance extends InstanceResource { /** * Initialize the CredentialInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The unique id of the Account that is responsible * for this resource. * @param string $credentialListSid The unique id that identifies the * credential list that includes this * credential * @param string $sid The unique id that identifies the resource to fetch. */ public function __construct(Version $version, array $payload, string $accountSid, string $credentialListSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Api/V2010/Account/Sip/CredentialListPage.php 0000644 00000002332 15107452332 0014332 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CredentialListPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Sip/DomainOptions.php 0000644 00000053031 15107452332 0013414 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Options; use Twilio\Values; abstract class DomainOptions { /** * @param string $friendlyName A string to describe the resource * @param string $voiceUrl The URL we should call when receiving a call * @param string $voiceMethod The HTTP method to use with voice_url * @param string $voiceFallbackUrl The URL we should call when an error occurs * in executing TwiML * @param string $voiceFallbackMethod The HTTP method to use with * voice_fallback_url * @param string $voiceStatusCallbackUrl The URL that we should call to pass * status updates * @param string $voiceStatusCallbackMethod The HTTP method we should use to * call `voice_status_callback_url` * @param bool $sipRegistration Whether SIP registration is allowed * @param bool $emergencyCallingEnabled Whether emergency calling is enabled * for the domain. * @param bool $secure Whether secure SIP is enabled for the domain * @param string $byocTrunkSid The SID of the BYOC Trunk resource. * @param string $emergencyCallerSid Whether an emergency caller sid is * configured for the domain. * @return CreateDomainOptions Options builder */ public static function create(string $friendlyName = Values::NONE, string $voiceUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceFallbackMethod = Values::NONE, string $voiceStatusCallbackUrl = Values::NONE, string $voiceStatusCallbackMethod = Values::NONE, bool $sipRegistration = Values::NONE, bool $emergencyCallingEnabled = Values::NONE, bool $secure = Values::NONE, string $byocTrunkSid = Values::NONE, string $emergencyCallerSid = Values::NONE): CreateDomainOptions { return new CreateDomainOptions($friendlyName, $voiceUrl, $voiceMethod, $voiceFallbackUrl, $voiceFallbackMethod, $voiceStatusCallbackUrl, $voiceStatusCallbackMethod, $sipRegistration, $emergencyCallingEnabled, $secure, $byocTrunkSid, $emergencyCallerSid); } /** * @param string $friendlyName A string to describe the resource * @param string $voiceFallbackMethod The HTTP method used with * voice_fallback_url * @param string $voiceFallbackUrl The URL we should call when an error occurs * in executing TwiML * @param string $voiceMethod The HTTP method we should use with voice_url * @param string $voiceStatusCallbackMethod The HTTP method we should use to * call voice_status_callback_url * @param string $voiceStatusCallbackUrl The URL that we should call to pass * status updates * @param string $voiceUrl The URL we should call when receiving a call * @param bool $sipRegistration Whether SIP registration is allowed * @param string $domainName The unique address on Twilio to route SIP traffic * @param bool $emergencyCallingEnabled Whether emergency calling is enabled * for the domain. * @param bool $secure Whether secure SIP is enabled for the domain * @param string $byocTrunkSid The SID of the BYOC Trunk resource. * @param string $emergencyCallerSid Whether an emergency caller sid is * configured for the domain. * @return UpdateDomainOptions Options builder */ public static function update(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::NONE, string $domainName = Values::NONE, bool $emergencyCallingEnabled = Values::NONE, bool $secure = Values::NONE, string $byocTrunkSid = Values::NONE, string $emergencyCallerSid = Values::NONE): UpdateDomainOptions { return new UpdateDomainOptions($friendlyName, $voiceFallbackMethod, $voiceFallbackUrl, $voiceMethod, $voiceStatusCallbackMethod, $voiceStatusCallbackUrl, $voiceUrl, $sipRegistration, $domainName, $emergencyCallingEnabled, $secure, $byocTrunkSid, $emergencyCallerSid); } } class CreateDomainOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $voiceUrl The URL we should call when receiving a call * @param string $voiceMethod The HTTP method to use with voice_url * @param string $voiceFallbackUrl The URL we should call when an error occurs * in executing TwiML * @param string $voiceFallbackMethod The HTTP method to use with * voice_fallback_url * @param string $voiceStatusCallbackUrl The URL that we should call to pass * status updates * @param string $voiceStatusCallbackMethod The HTTP method we should use to * call `voice_status_callback_url` * @param bool $sipRegistration Whether SIP registration is allowed * @param bool $emergencyCallingEnabled Whether emergency calling is enabled * for the domain. * @param bool $secure Whether secure SIP is enabled for the domain * @param string $byocTrunkSid The SID of the BYOC Trunk resource. * @param string $emergencyCallerSid Whether an emergency caller sid is * configured for the domain. */ public function __construct(string $friendlyName = Values::NONE, string $voiceUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceFallbackMethod = Values::NONE, string $voiceStatusCallbackUrl = Values::NONE, string $voiceStatusCallbackMethod = Values::NONE, bool $sipRegistration = Values::NONE, bool $emergencyCallingEnabled = Values::NONE, bool $secure = Values::NONE, string $byocTrunkSid = Values::NONE, string $emergencyCallerSid = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['voiceUrl'] = $voiceUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['voiceStatusCallbackUrl'] = $voiceStatusCallbackUrl; $this->options['voiceStatusCallbackMethod'] = $voiceStatusCallbackMethod; $this->options['sipRegistration'] = $sipRegistration; $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 string to describe the resource * @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 call when receiving 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 to use with 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 from `voice_url`. * * @param string $voiceFallbackUrl The URL we should call when an error occurs * in executing TwiML * @return $this Fluent Builder */ public function setVoiceFallbackUrl(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 to use with * voice_fallback_url * @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 updates * @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` * @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 SIP registration is allowed * @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. * @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 * @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 resource. * @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. * @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 string to describe the resource * @param string $voiceFallbackMethod The HTTP method used with * voice_fallback_url * @param string $voiceFallbackUrl The URL we should call when an error occurs * in executing TwiML * @param string $voiceMethod The HTTP method we should use with voice_url * @param string $voiceStatusCallbackMethod The HTTP method we should use to * call voice_status_callback_url * @param string $voiceStatusCallbackUrl The URL that we should call to pass * status updates * @param string $voiceUrl The URL we should call when receiving a call * @param bool $sipRegistration Whether SIP registration is allowed * @param string $domainName The unique address on Twilio to route SIP traffic * @param bool $emergencyCallingEnabled Whether emergency calling is enabled * for the domain. * @param bool $secure Whether secure SIP is enabled for the domain * @param string $byocTrunkSid The SID of the BYOC Trunk resource. * @param string $emergencyCallerSid Whether an emergency caller sid is * configured for the domain. */ 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::NONE, string $domainName = Values::NONE, bool $emergencyCallingEnabled = Values::NONE, bool $secure = Values::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 string to describe the resource * @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 used with * voice_fallback_url * @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 we should call when an error occurs * in executing TwiML * @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 with 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 * @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 updates * @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 receiving 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 SIP registration is allowed * @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 on Twilio to route SIP traffic * @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. * @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 * @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 resource. * @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. * @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 . ']'; } } Api/V2010/Account/Sip/IpAccessControlList/IpAddressContext.php 0000644 00000006564 15107452333 0017755 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlList; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class IpAddressContext extends InstanceContext { /** * Initialize the IpAddressContext * * @param Version $version Version that contains the resource * @param string $accountSid The unique sid that identifies this account * @param string $ipAccessControlListSid The IpAccessControlList Sid that * identifies the IpAddress resources to * fetch * @param string $sid A string that identifies the IpAddress resource to fetch */ public function __construct(Version $version, $accountSid, $ipAccessControlListSid, $sid) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'ipAccessControlListSid' => $ipAccessControlListSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SIP/IpAccessControlLists/' . \rawurlencode($ipAccessControlListSid) . '/IpAddresses/' . \rawurlencode($sid) . '.json'; } /** * Fetch the IpAddressInstance * * @return IpAddressInstance Fetched IpAddressInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): IpAddressInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new IpAddressInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['ipAccessControlListSid'], $this->solution['sid'] ); } /** * Delete the IpAddressInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Api/V2010/Account/Sip/IpAccessControlList/IpAddressOptions.php 0000644 00000014702 15107452333 0017755 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlList; use Twilio\Options; use Twilio\Values; abstract class IpAddressOptions { /** * @param int $cidrPrefixLength An integer representing the length of the CIDR * prefix to use with this IP address when * accepting traffic. By default the entire IP * address is used. * @return CreateIpAddressOptions Options builder */ public static function create(int $cidrPrefixLength = Values::NONE): CreateIpAddressOptions { return new CreateIpAddressOptions($cidrPrefixLength); } /** * @param string $ipAddress An IP address in dotted decimal notation from which * you want to accept traffic. Any SIP requests from * this IP address will be allowed by Twilio. IPv4 * only supported today. * @param string $friendlyName A human readable descriptive text for this * resource, up to 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. * @return UpdateIpAddressOptions Options builder */ public static function update(string $ipAddress = Values::NONE, string $friendlyName = Values::NONE, int $cidrPrefixLength = Values::NONE): UpdateIpAddressOptions { return new UpdateIpAddressOptions($ipAddress, $friendlyName, $cidrPrefixLength); } } class CreateIpAddressOptions extends Options { /** * @param int $cidrPrefixLength An integer representing the length of the CIDR * prefix to use with this IP address when * accepting traffic. By default the entire IP * address is used. */ public function __construct(int $cidrPrefixLength = Values::NONE) { $this->options['cidrPrefixLength'] = $cidrPrefixLength; } /** * An integer representing the length of the CIDR prefix to use with this IP address when accepting traffic. By default the entire IP address is used. * * @param int $cidrPrefixLength An integer representing the length of the CIDR * prefix to use with this IP address when * accepting traffic. By default the entire IP * address is used. * @return $this Fluent Builder */ public function setCidrPrefixLength(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::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 . ']'; } } Api/V2010/Account/Sip/IpAccessControlList/IpAddressList.php 0000644 00000015240 15107452333 0017233 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlList; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class IpAddressList extends ListResource { /** * Construct the IpAddressList * * @param Version $version Version that contains the resource * @param string $accountSid The unique id of the Account that is responsible * for this resource. * @param string $ipAccessControlListSid The unique id of the * IpAccessControlList resource that * includes this resource. */ public function __construct(Version $version, string $accountSid, string $ipAccessControlListSid) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'ipAccessControlListSid' => $ipAccessControlListSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SIP/IpAccessControlLists/' . \rawurlencode($ipAccessControlListSid) . '/IpAddresses.json'; } /** * Streams IpAddressInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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); } /** * 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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new IpAddressInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['ipAccessControlListSid'] ); } /** * Constructs a IpAddressContext * * @param string $sid A string that identifies the IpAddress resource to fetch */ 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]'; } } Api/V2010/Account/Sip/IpAccessControlList/IpAddressPage.php 0000644 00000002511 15107452333 0017171 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlList; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class IpAddressPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Sip/IpAccessControlList/IpAddressInstance.php 0000644 00000011540 15107452333 0020063 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlList; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $friendlyName * @property string $ipAddress * @property int $cidrPrefixLength * @property string $ipAccessControlListSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $uri */ class IpAddressInstance extends InstanceResource { /** * Initialize the IpAddressInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The unique id of the Account that is responsible * for this resource. * @param string $ipAccessControlListSid The unique id of the * IpAccessControlList resource that * includes this resource. * @param string $sid A string that identifies the IpAddress resource to fetch */ public function __construct(Version $version, array $payload, string $accountSid, string $ipAccessControlListSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Api/V2010/Account/Sip/IpAccessControlListInstance.php 0000644 00000011211 15107452333 0016200 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlList\IpAddressList; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property array $subresourceUris * @property string $uri */ class IpAccessControlListInstance extends InstanceResource { protected $_ipAddresses; /** * Initialize the IpAccessControlListInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @param string $sid A string that identifies the resource to fetch */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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 description of this resource * @return IpAccessControlListInstance Updated IpAccessControlListInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $friendlyName): IpAccessControlListInstance { return $this->proxy()->update($friendlyName); } /** * 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(); } /** * 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) . ']'; } } Api/V2010/Account/Sip/IpAccessControlListList.php 0000644 00000013227 15107452333 0015360 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class IpAccessControlListList extends ListResource { /** * Construct the IpAccessControlListList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SIP/IpAccessControlLists.json'; } /** * Streams IpAccessControlListInstance records from the API as a generator * stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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); } /** * Create the IpAccessControlListInstance * * @param string $friendlyName A human readable description of this resource * @return IpAccessControlListInstance Created IpAccessControlListInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName): IpAccessControlListInstance { $data = Values::of(['FriendlyName' => $friendlyName, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new IpAccessControlListInstance($this->version, $payload, $this->solution['accountSid']); } /** * Constructs a IpAccessControlListContext * * @param string $sid A string that identifies the resource to fetch */ 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]'; } } Api/V2010/Account/Sip/DomainPage.php 0000644 00000002252 15107452333 0012635 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class DomainPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Sip/CredentialListInstance.php 0000644 00000010763 15107452333 0015232 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Rest\Api\V2010\Account\Sip\CredentialList\CredentialList; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $sid * @property array $subresourceUris * @property string $uri */ class CredentialListInstance extends InstanceResource { protected $_credentials; /** * Initialize the CredentialListInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @param string $sid Fetch by unique credential list Sid */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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 Human readable descriptive text * @return CredentialListInstance Updated CredentialListInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $friendlyName): CredentialListInstance { return $this->proxy()->update($friendlyName); } /** * 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(); } /** * 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) . ']'; } } Api/V2010/Account/Sip/CredentialListList.php 0000644 00000012772 15107452333 0014403 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class CredentialListList extends ListResource { /** * Construct the CredentialListList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SIP/CredentialLists.json'; } /** * Streams CredentialListInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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); } /** * Create the CredentialListInstance * * @param string $friendlyName Human readable descriptive text * @return CredentialListInstance Created CredentialListInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName): CredentialListInstance { $data = Values::of(['FriendlyName' => $friendlyName, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CredentialListInstance($this->version, $payload, $this->solution['accountSid']); } /** * Constructs a CredentialListContext * * @param string $sid Fetch by unique credential list Sid */ 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]'; } } Api/V2010/Account/Sip/DomainContext.php 0000644 00000015261 15107452333 0013411 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypesList; use Twilio\Rest\Api\V2010\Account\Sip\Domain\CredentialListMappingList; use Twilio\Rest\Api\V2010\Account\Sip\Domain\IpAccessControlListMappingList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property IpAccessControlListMappingList $ipAccessControlListMappings * @property CredentialListMappingList $credentialListMappings * @property AuthTypesList $auth * @method \Twilio\Rest\Api\V2010\Account\Sip\Domain\IpAccessControlListMappingContext ipAccessControlListMappings(string $sid) * @method \Twilio\Rest\Api\V2010\Account\Sip\Domain\CredentialListMappingContext credentialListMappings(string $sid) */ class DomainContext extends InstanceContext { protected $_ipAccessControlListMappings; protected $_credentialListMappings; protected $_auth; /** * Initialize the DomainContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SIP/Domains/' . \rawurlencode($sid) . '.json'; } /** * Fetch the DomainInstance * * @return DomainInstance Fetched DomainInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DomainInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new DomainInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Delete the DomainInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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 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 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) . ']'; } } Api/V2010/Account/Sip/CredentialListContext.php 0000644 00000011000 15107452333 0015073 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Api\V2010\Account\Sip\CredentialList\CredentialList; use Twilio\Values; use Twilio\Version; /** * @property CredentialList $credentials * @method \Twilio\Rest\Api\V2010\Account\Sip\CredentialList\CredentialContext credentials(string $sid) */ class CredentialListContext extends InstanceContext { protected $_credentials; /** * Initialize the CredentialListContext * * @param Version $version Version that contains the resource * @param string $accountSid The unique id of the Account that is responsible * for this resource. * @param string $sid Fetch by unique credential list Sid */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SIP/CredentialLists/' . \rawurlencode($sid) . '.json'; } /** * Fetch the CredentialListInstance * * @return CredentialListInstance Fetched CredentialListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialListInstance { $payload = $this->version->fetch('GET', $this->uri); return new CredentialListInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Update the CredentialListInstance * * @param string $friendlyName Human readable descriptive text * @return CredentialListInstance Updated CredentialListInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $friendlyName): CredentialListInstance { $data = Values::of(['FriendlyName' => $friendlyName, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new CredentialListInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Delete the CredentialListInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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) . ']'; } }Api/V2010/Account/Sip/IpAccessControlListContext.php 0000644 00000011060 15107452333 0016062 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlList\IpAddressList; use Twilio\Values; use Twilio\Version; /** * @property IpAddressList $ipAddresses * @method \Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlList\IpAddressContext ipAddresses(string $sid) */ class IpAccessControlListContext extends InstanceContext { protected $_ipAddresses; /** * Initialize the IpAccessControlListContext * * @param Version $version Version that contains the resource * @param string $accountSid The unique sid that identifies this account * @param string $sid A string that identifies the resource to fetch */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SIP/IpAccessControlLists/' . \rawurlencode($sid) . '.json'; } /** * Fetch the IpAccessControlListInstance * * @return IpAccessControlListInstance Fetched IpAccessControlListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): IpAccessControlListInstance { $payload = $this->version->fetch('GET', $this->uri); return new IpAccessControlListInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Update the IpAccessControlListInstance * * @param string $friendlyName A human readable description of this resource * @return IpAccessControlListInstance Updated IpAccessControlListInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $friendlyName): IpAccessControlListInstance { $data = Values::of(['FriendlyName' => $friendlyName, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new IpAccessControlListInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Delete the IpAccessControlListInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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) . ']'; } } Api/V2010/Account/Sip/DomainInstance.php 0000644 00000015126 15107452333 0013531 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypesList; use Twilio\Rest\Api\V2010\Account\Sip\Domain\CredentialListMappingList; use Twilio\Rest\Api\V2010\Account\Sip\Domain\IpAccessControlListMappingList; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property string $authType * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $domainName * @property string $friendlyName * @property string $sid * @property string $uri * @property string $voiceFallbackMethod * @property string $voiceFallbackUrl * @property string $voiceMethod * @property string $voiceStatusCallbackMethod * @property string $voiceStatusCallbackUrl * @property string $voiceUrl * @property array $subresourceUris * @property bool $sipRegistration * @property bool $emergencyCallingEnabled * @property bool $secure * @property string $byocTrunkSid * @property string $emergencyCallerSid */ class DomainInstance extends InstanceResource { protected $_ipAccessControlListMappings; protected $_credentialListMappings; protected $_auth; /** * Initialize the DomainInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Access the ipAccessControlListMappings */ protected function getIpAccessControlListMappings(): IpAccessControlListMappingList { return $this->proxy()->ipAccessControlListMappings; } /** * Access the credentialListMappings */ protected function getCredentialListMappings(): CredentialListMappingList { return $this->proxy()->credentialListMappings; } /** * 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) . ']'; } } Api/V2010/Account/Sip/Domain/CredentialListMappingInstance.php 0000644 00000010365 15107452333 0017753 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $domainSid * @property string $friendlyName * @property string $sid * @property string $uri */ class CredentialListMappingInstance extends InstanceResource { /** * Initialize the CredentialListMappingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The unique id of the Account that is responsible * for this resource. * @param string $domainSid The unique string that identifies the SipDomain * resource. * @param string $sid A string that identifies the resource to fetch */ public function __construct(Version $version, array $payload, string $accountSid, string $domainSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the CredentialListMappingInstance * * @return CredentialListMappingInstance Fetched CredentialListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialListMappingInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrationsList.php 0000644 00000006136 15107452333 0021150 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeRegistrations\AuthRegistrationsCredentialListMappingList; use Twilio\Version; /** * @property AuthRegistrationsCredentialListMappingList $credentialListMappings * @method \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeRegistrations\AuthRegistrationsCredentialListMappingContext credentialListMappings(string $sid) */ class AuthTypeRegistrationsList extends ListResource { protected $_credentialListMappings = null; /** * Construct the AuthTypeRegistrationsList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @param string $domainSid The unique string that identifies the resource */ public function __construct(Version $version, string $accountSid, string $domainSid) { parent::__construct($version); // Path Solution $this->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]'; } } Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrationsPage.php 0000644 00000002576 15107452333 0021115 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AuthTypeRegistrationsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrationsInstance.php 0000644 00000003344 15107452333 0021777 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; class AuthTypeRegistrationsInstance extends InstanceResource { /** * Initialize the AuthTypeRegistrationsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $domainSid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $accountSid, string $domainSid) { parent::__construct($version); $this->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]'; } } Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingContext.php 0000644 00000005143 15107452333 0026102 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class AuthCallsCredentialListMappingContext extends InstanceContext { /** * Initialize the AuthCallsCredentialListMappingContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $domainSid The SID of the SIP domain that contains the * resource to fetch * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $accountSid, $domainSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SIP/Domains/' . \rawurlencode($domainSid) . '/Auth/Calls/CredentialListMappings/' . \rawurlencode($sid) . '.json'; } /** * Fetch the AuthCallsCredentialListMappingInstance * * @return AuthCallsCredentialListMappingInstance Fetched * AuthCallsCredentialListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AuthCallsCredentialListMappingInstance { $payload = $this->version->fetch('GET', $this->uri); return new AuthCallsCredentialListMappingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'], $this->solution['sid'] ); } /** * Delete the AuthCallsCredentialListMappingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingContext.php 0000644 00000005232 15107452333 0027062 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class AuthCallsIpAccessControlListMappingContext extends InstanceContext { /** * Initialize the AuthCallsIpAccessControlListMappingContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $domainSid The SID of the SIP domain that contains the * resource to fetch * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $accountSid, $domainSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SIP/Domains/' . \rawurlencode($domainSid) . '/Auth/Calls/IpAccessControlListMappings/' . \rawurlencode($sid) . '.json'; } /** * Fetch the AuthCallsIpAccessControlListMappingInstance * * @return AuthCallsIpAccessControlListMappingInstance Fetched * AuthCallsIpAccessControlListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AuthCallsIpAccessControlListMappingInstance { $payload = $this->version->fetch('GET', $this->uri); return new AuthCallsIpAccessControlListMappingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'], $this->solution['sid'] ); } /** * Delete the AuthCallsIpAccessControlListMappingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingList.php 0000644 00000015233 15107452333 0026353 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class AuthCallsIpAccessControlListMappingList extends ListResource { /** * Construct the AuthCallsIpAccessControlListMappingList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @param string $domainSid The unique string that identifies the resource */ public function __construct(Version $version, string $accountSid, string $domainSid) { parent::__construct($version); // Path Solution $this->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, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AuthCallsIpAccessControlListMappingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'] ); } /** * Streams AuthCallsIpAccessControlListMappingInstance records from the API as * a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 unique string that identifies the resource */ 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]'; } } Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingList.php 0000644 00000014752 15107452333 0025377 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class AuthCallsCredentialListMappingList extends ListResource { /** * Construct the AuthCallsCredentialListMappingList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @param string $domainSid The unique string that identifies the resource */ public function __construct(Version $version, string $accountSid, string $domainSid) { parent::__construct($version); // Path Solution $this->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, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AuthCallsCredentialListMappingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'] ); } /** * Streams AuthCallsCredentialListMappingInstance records from the API as a * generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 unique string that identifies the resource */ 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]'; } } Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingPage.php 0000644 00000002756 15107452333 0026322 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AuthCallsIpAccessControlListMappingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingPage.php 0000644 00000002720 15107452333 0025330 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AuthCallsCredentialListMappingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingInstance.php0000644 00000010350 15107452333 0027177 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $sid */ class AuthCallsIpAccessControlListMappingInstance extends InstanceResource { /** * Initialize the AuthCallsIpAccessControlListMappingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $domainSid The unique string that identifies the resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $accountSid, string $domainSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the AuthCallsIpAccessControlListMappingInstance * * @return AuthCallsIpAccessControlListMappingInstance Fetched * AuthCallsIpAccessControlListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AuthCallsIpAccessControlListMappingInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingInstance.php 0000644 00000010242 15107452333 0026216 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $sid */ class AuthCallsCredentialListMappingInstance extends InstanceResource { /** * Initialize the AuthCallsCredentialListMappingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $domainSid The unique string that identifies the resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $accountSid, string $domainSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the AuthCallsCredentialListMappingInstance * * @return AuthCallsCredentialListMappingInstance Fetched * AuthCallsCredentialListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AuthCallsCredentialListMappingInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCallsInstance.php 0000644 00000003314 15107452333 0020175 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; class AuthTypeCallsInstance extends InstanceResource { /** * Initialize the AuthTypeCallsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $domainSid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $accountSid, string $domainSid) { parent::__construct($version); $this->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]'; } } Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCallsList.php 0000644 00000007650 15107452333 0017353 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls\AuthCallsCredentialListMappingList; use Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls\AuthCallsIpAccessControlListMappingList; use Twilio\Version; /** * @property AuthCallsCredentialListMappingList $credentialListMappings * @property AuthCallsIpAccessControlListMappingList $ipAccessControlListMappings * @method \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls\AuthCallsCredentialListMappingContext credentialListMappings(string $sid) * @method \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls\AuthCallsIpAccessControlListMappingContext ipAccessControlListMappings(string $sid) */ class AuthTypeCallsList extends ListResource { protected $_credentialListMappings = null; protected $_ipAccessControlListMappings = null; /** * Construct the AuthTypeCallsList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @param string $domainSid The unique string that identifies the resource */ public function __construct(Version $version, string $accountSid, string $domainSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'domainSid' => $domainSid, ]; } /** * 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; } /** * 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; } /** * 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]'; } } Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCallsPage.php 0000644 00000002516 15107452333 0017310 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AuthTypeCallsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingPage.php 0000644 00000003020 15107452333 0030641 0 ustar 00 Api/V2010 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeRegistrations; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AuthRegistrationsCredentialListMappingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingInstance.php 0000644 00000010432 15107452333 0031536 0 ustar 00 Api/V2010/Account <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeRegistrations; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $sid */ class AuthRegistrationsCredentialListMappingInstance extends InstanceResource { /** * Initialize the AuthRegistrationsCredentialListMappingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $domainSid The unique string that identifies the resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $accountSid, string $domainSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the AuthRegistrationsCredentialListMappingInstance * * @return AuthRegistrationsCredentialListMappingInstance Fetched * AuthRegistrationsCredentialListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AuthRegistrationsCredentialListMappingInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingContext.php0000644 00000005303 15107452333 0031417 0 ustar 00 Api/V2010 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeRegistrations; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class AuthRegistrationsCredentialListMappingContext extends InstanceContext { /** * Initialize the AuthRegistrationsCredentialListMappingContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $domainSid The SID of the SIP domain that contains the * resource to fetch * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $accountSid, $domainSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SIP/Domains/' . \rawurlencode($domainSid) . '/Auth/Registrations/CredentialListMappings/' . \rawurlencode($sid) . '.json'; } /** * Fetch the AuthRegistrationsCredentialListMappingInstance * * @return AuthRegistrationsCredentialListMappingInstance Fetched * AuthRegistrationsCredentialListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AuthRegistrationsCredentialListMappingInstance { $payload = $this->version->fetch('GET', $this->uri); return new AuthRegistrationsCredentialListMappingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'], $this->solution['sid'] ); } /** * Delete the AuthRegistrationsCredentialListMappingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingList.php 0000644 00000015331 15107452333 0030710 0 ustar 00 Api/V2010 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeRegistrations; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class AuthRegistrationsCredentialListMappingList extends ListResource { /** * Construct the AuthRegistrationsCredentialListMappingList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @param string $domainSid The unique string that identifies the resource */ public function __construct(Version $version, string $accountSid, string $domainSid) { parent::__construct($version); // Path Solution $this->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, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AuthRegistrationsCredentialListMappingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'] ); } /** * Streams AuthRegistrationsCredentialListMappingInstance records from the API * as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 unique string that identifies the resource */ 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]'; } } Api/V2010/Account/Sip/Domain/IpAccessControlListMappingContext.php 0000644 00000005053 15107452333 0020612 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class IpAccessControlListMappingContext extends InstanceContext { /** * Initialize the IpAccessControlListMappingContext * * @param Version $version Version that contains the resource * @param string $accountSid The unique id of the Account that is responsible * for this resource. * @param string $domainSid A string that uniquely identifies the SIP Domain * @param string $sid A 34 character string that uniquely identifies the * resource to fetch. */ public function __construct(Version $version, $accountSid, $domainSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SIP/Domains/' . \rawurlencode($domainSid) . '/IpAccessControlListMappings/' . \rawurlencode($sid) . '.json'; } /** * Fetch the IpAccessControlListMappingInstance * * @return IpAccessControlListMappingInstance Fetched * IpAccessControlListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): IpAccessControlListMappingInstance { $payload = $this->version->fetch('GET', $this->uri); return new IpAccessControlListMappingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'], $this->solution['sid'] ); } /** * Delete the IpAccessControlListMappingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Api/V2010/Account/Sip/Domain/AuthTypesInstance.php 0000644 00000003266 15107452333 0015461 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; class AuthTypesInstance extends InstanceResource { /** * Initialize the AuthTypesInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $domainSid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $accountSid, string $domainSid) { parent::__construct($version); $this->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]'; } } Api/V2010/Account/Sip/Domain/IpAccessControlListMappingInstance.php 0000644 00000010631 15107452333 0020730 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $domainSid * @property string $friendlyName * @property string $sid * @property string $uri */ class IpAccessControlListMappingInstance extends InstanceResource { /** * Initialize the IpAccessControlListMappingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The unique id of the Account that is responsible * for this resource. * @param string $domainSid The unique string that identifies the SipDomain * resource. * @param string $sid A 34 character string that uniquely identifies the * resource to fetch. */ public function __construct(Version $version, array $payload, string $accountSid, string $domainSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the IpAccessControlListMappingInstance * * @return IpAccessControlListMappingInstance Fetched * IpAccessControlListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): IpAccessControlListMappingInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Api/V2010/Account/Sip/Domain/CredentialListMappingContext.php 0000644 00000004630 15107452333 0017631 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class CredentialListMappingContext extends InstanceContext { /** * Initialize the CredentialListMappingContext * * @param Version $version Version that contains the resource * @param string $accountSid The unique sid that identifies this account * @param string $domainSid A string that identifies the SIP Domain that * includes the resource to fetch * @param string $sid A string that identifies the resource to fetch */ public function __construct(Version $version, $accountSid, $domainSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SIP/Domains/' . \rawurlencode($domainSid) . '/CredentialListMappings/' . \rawurlencode($sid) . '.json'; } /** * Fetch the CredentialListMappingInstance * * @return CredentialListMappingInstance Fetched CredentialListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialListMappingInstance { $payload = $this->version->fetch('GET', $this->uri); return new CredentialListMappingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'], $this->solution['sid'] ); } /** * Delete the CredentialListMappingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Api/V2010/Account/Sip/Domain/IpAccessControlListMappingList.php 0000644 00000015016 15107452333 0020101 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class IpAccessControlListMappingList extends ListResource { /** * Construct the IpAccessControlListMappingList * * @param Version $version Version that contains the resource * @param string $accountSid The unique id of the Account that is responsible * for this resource. * @param string $domainSid The unique string that identifies the SipDomain * resource. */ public function __construct(Version $version, string $accountSid, string $domainSid) { parent::__construct($version); // Path Solution $this->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, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new IpAccessControlListMappingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'] ); } /** * Streams IpAccessControlListMappingInstance records from the API as a * generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 fetch. */ 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]'; } } Api/V2010/Account/Sip/Domain/CredentialListMappingPage.php 0000644 00000002552 15107452333 0017062 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CredentialListMappingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Sip/Domain/AuthTypesList.php 0000644 00000006351 15107452333 0014626 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCallsList; use Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeRegistrationsList; use Twilio\Version; /** * @property AuthTypeCallsList $calls * @property AuthTypeRegistrationsList $registrations */ class AuthTypesList extends ListResource { protected $_calls = null; protected $_registrations = null; /** * Construct the AuthTypesList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @param string $domainSid The unique string that identifies the resource */ public function __construct(Version $version, string $accountSid, string $domainSid) { parent::__construct($version); // Path Solution $this->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]'; } } Api/V2010/Account/Sip/Domain/IpAccessControlListMappingPage.php 0000644 00000002610 15107452333 0020036 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class IpAccessControlListMappingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Sip/Domain/AuthTypesPage.php 0000644 00000002442 15107452333 0014564 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AuthTypesPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Sip/Domain/CredentialListMappingList.php 0000644 00000014273 15107452333 0017124 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class CredentialListMappingList extends ListResource { /** * Construct the CredentialListMappingList * * @param Version $version Version that contains the resource * @param string $accountSid The unique id of the Account that is responsible * for this resource. * @param string $domainSid The unique string that identifies the SipDomain * resource. */ public function __construct(Version $version, string $accountSid, string $domainSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'domainSid' => $domainSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SIP/Domains/' . \rawurlencode($domainSid) . '/CredentialListMappings.json'; } /** * Create the CredentialListMappingInstance * * @param string $credentialListSid A string that 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, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CredentialListMappingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'] ); } /** * Streams CredentialListMappingInstance records from the API as a generator * stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 string that identifies the resource to fetch */ 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]'; } } Api/V2010/Account/Sip/DomainList.php 0000644 00000014507 15107452333 0012702 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class DomainList extends ListResource { /** * Construct the DomainList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SIP/Domains.json'; } /** * Streams DomainInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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); } /** * Create the DomainInstance * * @param string $domainName The unique address on Twilio to route SIP traffic * @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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new DomainInstance($this->version, $payload, $this->solution['accountSid']); } /** * Constructs a DomainContext * * @param string $sid The unique string that identifies the resource */ 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]'; } } Api/V2010/Account/ConferenceInstance.php 0000644 00000011657 15107452333 0013643 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Api\V2010\Account\Conference\ParticipantList; use Twilio\Rest\Api\V2010\Account\Conference\RecordingList; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $apiVersion * @property string $friendlyName * @property string $region * @property string $sid * @property string $status * @property string $uri * @property array $subresourceUris * @property string $reasonConferenceEnded * @property string $callSidEndingConference */ class ConferenceInstance extends InstanceResource { protected $_participants; protected $_recordings; /** * Initialize the ConferenceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created this resource * @param string $sid The unique string that identifies this resource */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Api/V2010/Account/ValidationRequestInstance.php 0000644 00000004254 15107452333 0015232 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $callSid * @property string $friendlyName * @property string $phoneNumber * @property string $validationCode */ class ValidationRequestInstance extends InstanceResource { /** * Initialize the ValidationRequestInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Api/V2010/Account/UsagePage.php 0000644 00000002234 15107452333 0011737 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UsagePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/ApplicationContext.php 0000644 00000007445 15107452333 0013717 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class ApplicationContext extends InstanceContext { /** * Initialize the ApplicationContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->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 { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the ApplicationInstance * * @return ApplicationInstance Fetched ApplicationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ApplicationInstance { $payload = $this->version->fetch('GET', $this->uri); 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']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ApplicationInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.ApplicationContext ' . \implode(' ', $context) . ']'; } } Api/V2010/Account/IncomingPhoneNumberContext.php 0000644 00000014003 15107452333 0015346 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOnList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property AssignedAddOnList $assignedAddOns * @method \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOnContext assignedAddOns(string $sid) */ class IncomingPhoneNumberContext extends InstanceContext { protected $_assignedAddOns; /** * Initialize the IncomingPhoneNumberContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/IncomingPhoneNumbers/' . \rawurlencode($sid) . '.json'; } /** * Update the IncomingPhoneNumberInstance * * @param array|Options $options Optional Arguments * @return IncomingPhoneNumberInstance Updated IncomingPhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function update(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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new IncomingPhoneNumberInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Fetch the IncomingPhoneNumberInstance * * @return IncomingPhoneNumberInstance Fetched IncomingPhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): IncomingPhoneNumberInstance { $payload = $this->version->fetch('GET', $this->uri); return new IncomingPhoneNumberInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Delete the IncomingPhoneNumberInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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) . ']'; } } Api/V2010/Account/AvailablePhoneNumberCountryList.php 0000644 00000012620 15107452333 0016341 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class AvailablePhoneNumberCountryList extends ListResource { /** * Construct the AvailablePhoneNumberCountryList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/AvailablePhoneNumbers.json'; } /** * Streams AvailablePhoneNumberCountryInstance records from the API as a * generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 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]'; } } Api/V2010/Account/AvailablePhoneNumberCountry/LocalPage.php 0000644 00000002456 15107452333 0017342 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class LocalPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/AvailablePhoneNumberCountry/LocalList.php 0000644 00000014237 15107452333 0017401 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class LocalList extends ListResource { /** * Construct the LocalList * * @param Version $version Version that contains the resource * @param string $accountSid The account_sid * @param string $countryCode The ISO-3166-1 country code of the country. */ public function __construct(Version $version, string $accountSid, string $countryCode) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/AvailablePhoneNumbers/' . \rawurlencode($countryCode) . '/Local.json'; } /** * Streams LocalInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of LocalInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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]'; } } Api/V2010/Account/AvailablePhoneNumberCountry/LocalInstance.php 0000644 00000006033 15107452333 0020225 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $friendlyName * @property string $phoneNumber * @property string $lata * @property string $locality * @property string $rateCenter * @property string $latitude * @property string $longitude * @property string $region * @property string $postalCode * @property string $isoCountry * @property string $addressRequirements * @property bool $beta * @property string $capabilities */ class LocalInstance extends InstanceResource { /** * Initialize the LocalInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The account_sid * @param string $countryCode The ISO-3166-1 country code of the country. */ public function __construct(Version $version, array $payload, string $accountSid, string $countryCode) { parent::__construct($version); // Marshaled Properties $this->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' => 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]'; } } Api/V2010/Account/AvailablePhoneNumberCountry/NationalPage.php 0000644 00000002500 15107452333 0020043 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class NationalPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachinePage.php 0000644 00000002560 15107452333 0021440 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MachineToMachinePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/AvailablePhoneNumberCountry/TollFreePage.php 0000644 00000002500 15107452333 0020012 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class TollFreePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/AvailablePhoneNumberCountry/MobileList.php 0000644 00000014260 15107452333 0017552 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class MobileList extends ListResource { /** * Construct the MobileList * * @param Version $version Version that contains the resource * @param string $accountSid The account_sid * @param string $countryCode The ISO-3166-1 country code of the country. */ public function __construct(Version $version, string $accountSid, string $countryCode) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/AvailablePhoneNumbers/' . \rawurlencode($countryCode) . '/Mobile.json'; } /** * Streams MobileInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of MobileInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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]'; } } Api/V2010/Account/AvailablePhoneNumberCountry/VoipList.php 0000644 00000014216 15107452333 0017261 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class VoipList extends ListResource { /** * Construct the VoipList * * @param Version $version Version that contains the resource * @param string $accountSid The account_sid * @param string $countryCode The ISO-3166-1 country code of the country. */ public function __construct(Version $version, string $accountSid, string $countryCode) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/AvailablePhoneNumbers/' . \rawurlencode($countryCode) . '/Voip.json'; } /** * Streams VoipInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of VoipInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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]'; } } Api/V2010/Account/AvailablePhoneNumberCountry/NationalInstance.php 0000644 00000006044 15107452333 0020742 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $friendlyName * @property string $phoneNumber * @property string $lata * @property string $locality * @property string $rateCenter * @property string $latitude * @property string $longitude * @property string $region * @property string $postalCode * @property string $isoCountry * @property string $addressRequirements * @property bool $beta * @property string $capabilities */ class NationalInstance extends InstanceResource { /** * Initialize the NationalInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The account_sid * @param string $countryCode The ISO-3166-1 country code of the country. */ public function __construct(Version $version, array $payload, string $accountSid, string $countryCode) { parent::__construct($version); // Marshaled Properties $this->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' => 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]'; } } Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineOptions.php 0000644 00000041047 15107452333 0022222 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Options; use Twilio\Values; abstract class MachineToMachineOptions { /** * @param int $areaCode The area code of the phone numbers to read * @param string $contains The pattern on which to match phone numbers * @param bool $smsEnabled Whether the phone numbers can receive text messages * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages * @param bool $voiceEnabled Whether the phone numbers can receive calls. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that * require an Address * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers * that require a local address * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers * that require a foreign address * @param bool $beta Whether to read phone numbers new to the Twilio platform * @param string $nearNumber Given a phone number, find a geographically close * number within distance miles. (US/Canada only) * @param string $nearLatLong Given a latitude/longitude pair lat,long find * geographically close numbers within distance * miles. (US/Canada only) * @param int $distance The search radius, in miles, for a near_ query. * (US/Canada only) * @param string $inPostalCode Limit results to a particular postal code. * (US/Canada only) * @param string $inRegion Limit results to a particular region. (US/Canada * only) * @param string $inRateCenter Limit results to a specific rate center, or * given a phone number search within the same rate * center as that number. (US/Canada only) * @param string $inLata Limit results to a specific local access and transport * area. (US/Canada only) * @param string $inLocality Limit results to a particular locality * @param bool $faxEnabled Whether the phone numbers can receive faxes * @return ReadMachineToMachineOptions Options builder */ public static function read(int $areaCode = Values::NONE, string $contains = Values::NONE, bool $smsEnabled = Values::NONE, bool $mmsEnabled = Values::NONE, bool $voiceEnabled = Values::NONE, bool $excludeAllAddressRequired = Values::NONE, bool $excludeLocalAddressRequired = Values::NONE, bool $excludeForeignAddressRequired = Values::NONE, bool $beta = Values::NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::NONE): ReadMachineToMachineOptions { return new ReadMachineToMachineOptions($areaCode, $contains, $smsEnabled, $mmsEnabled, $voiceEnabled, $excludeAllAddressRequired, $excludeLocalAddressRequired, $excludeForeignAddressRequired, $beta, $nearNumber, $nearLatLong, $distance, $inPostalCode, $inRegion, $inRateCenter, $inLata, $inLocality, $faxEnabled); } } class ReadMachineToMachineOptions extends Options { /** * @param int $areaCode The area code of the phone numbers to read * @param string $contains The pattern on which to match phone numbers * @param bool $smsEnabled Whether the phone numbers can receive text messages * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages * @param bool $voiceEnabled Whether the phone numbers can receive calls. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that * require an Address * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers * that require a local address * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers * that require a foreign address * @param bool $beta Whether to read phone numbers new to the Twilio platform * @param string $nearNumber Given a phone number, find a geographically close * number within distance miles. (US/Canada only) * @param string $nearLatLong Given a latitude/longitude pair lat,long find * geographically close numbers within distance * miles. (US/Canada only) * @param int $distance The search radius, in miles, for a near_ query. * (US/Canada only) * @param string $inPostalCode Limit results to a particular postal code. * (US/Canada only) * @param string $inRegion Limit results to a particular region. (US/Canada * only) * @param string $inRateCenter Limit results to a specific rate center, or * given a phone number search within the same rate * center as that number. (US/Canada only) * @param string $inLata Limit results to a specific local access and transport * area. (US/Canada only) * @param string $inLocality Limit results to a particular locality * @param bool $faxEnabled Whether the phone numbers can receive faxes */ public function __construct(int $areaCode = Values::NONE, string $contains = Values::NONE, bool $smsEnabled = Values::NONE, bool $mmsEnabled = Values::NONE, bool $voiceEnabled = Values::NONE, bool $excludeAllAddressRequired = Values::NONE, bool $excludeLocalAddressRequired = Values::NONE, bool $excludeForeignAddressRequired = Values::NONE, bool $beta = Values::NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::NONE) { $this->options['areaCode'] = $areaCode; $this->options['contains'] = $contains; $this->options['smsEnabled'] = $smsEnabled; $this->options['mmsEnabled'] = $mmsEnabled; $this->options['voiceEnabled'] = $voiceEnabled; $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; $this->options['beta'] = $beta; $this->options['nearNumber'] = $nearNumber; $this->options['nearLatLong'] = $nearLatLong; $this->options['distance'] = $distance; $this->options['inPostalCode'] = $inPostalCode; $this->options['inRegion'] = $inRegion; $this->options['inRateCenter'] = $inRateCenter; $this->options['inLata'] = $inLata; $this->options['inLocality'] = $inLocality; $this->options['faxEnabled'] = $faxEnabled; } /** * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * * @param int $areaCode The area code of the phone numbers to read * @return $this Fluent Builder */ public function setAreaCode(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 * @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 * @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 * @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. * @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 * @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 * @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 * @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 new to the Twilio platform * @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. (US/Canada only) * @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. (US/Canada only) * @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. * (US/Canada only) * @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. * (US/Canada only) * @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. (US/Canada * only) * @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. (US/Canada only) * @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. (US/Canada only) * @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 * @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 * @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 . ']'; } } Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostOptions.php 0000644 00000041003 15107452333 0021115 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Options; use Twilio\Values; abstract class SharedCostOptions { /** * @param int $areaCode The area code of the phone numbers to read * @param string $contains The pattern on which to match phone numbers * @param bool $smsEnabled Whether the phone numbers can receive text messages * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages * @param bool $voiceEnabled Whether the phone numbers can receive calls. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that * require an Address * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers * that require a local address * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers * that require a foreign address * @param bool $beta Whether to read phone numbers new to the Twilio platform * @param string $nearNumber Given a phone number, find a geographically close * number within distance miles. (US/Canada only) * @param string $nearLatLong Given a latitude/longitude pair lat,long find * geographically close numbers within distance * miles. (US/Canada only) * @param int $distance The search radius, in miles, for a near_ query. * (US/Canada only) * @param string $inPostalCode Limit results to a particular postal code. * (US/Canada only) * @param string $inRegion Limit results to a particular region. (US/Canada * only) * @param string $inRateCenter Limit results to a specific rate center, or * given a phone number search within the same rate * center as that number. (US/Canada only) * @param string $inLata Limit results to a specific local access and transport * area. (US/Canada only) * @param string $inLocality Limit results to a particular locality * @param bool $faxEnabled Whether the phone numbers can receive faxes * @return ReadSharedCostOptions Options builder */ public static function read(int $areaCode = Values::NONE, string $contains = Values::NONE, bool $smsEnabled = Values::NONE, bool $mmsEnabled = Values::NONE, bool $voiceEnabled = Values::NONE, bool $excludeAllAddressRequired = Values::NONE, bool $excludeLocalAddressRequired = Values::NONE, bool $excludeForeignAddressRequired = Values::NONE, bool $beta = Values::NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::NONE): ReadSharedCostOptions { return new ReadSharedCostOptions($areaCode, $contains, $smsEnabled, $mmsEnabled, $voiceEnabled, $excludeAllAddressRequired, $excludeLocalAddressRequired, $excludeForeignAddressRequired, $beta, $nearNumber, $nearLatLong, $distance, $inPostalCode, $inRegion, $inRateCenter, $inLata, $inLocality, $faxEnabled); } } class ReadSharedCostOptions extends Options { /** * @param int $areaCode The area code of the phone numbers to read * @param string $contains The pattern on which to match phone numbers * @param bool $smsEnabled Whether the phone numbers can receive text messages * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages * @param bool $voiceEnabled Whether the phone numbers can receive calls. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that * require an Address * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers * that require a local address * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers * that require a foreign address * @param bool $beta Whether to read phone numbers new to the Twilio platform * @param string $nearNumber Given a phone number, find a geographically close * number within distance miles. (US/Canada only) * @param string $nearLatLong Given a latitude/longitude pair lat,long find * geographically close numbers within distance * miles. (US/Canada only) * @param int $distance The search radius, in miles, for a near_ query. * (US/Canada only) * @param string $inPostalCode Limit results to a particular postal code. * (US/Canada only) * @param string $inRegion Limit results to a particular region. (US/Canada * only) * @param string $inRateCenter Limit results to a specific rate center, or * given a phone number search within the same rate * center as that number. (US/Canada only) * @param string $inLata Limit results to a specific local access and transport * area. (US/Canada only) * @param string $inLocality Limit results to a particular locality * @param bool $faxEnabled Whether the phone numbers can receive faxes */ public function __construct(int $areaCode = Values::NONE, string $contains = Values::NONE, bool $smsEnabled = Values::NONE, bool $mmsEnabled = Values::NONE, bool $voiceEnabled = Values::NONE, bool $excludeAllAddressRequired = Values::NONE, bool $excludeLocalAddressRequired = Values::NONE, bool $excludeForeignAddressRequired = Values::NONE, bool $beta = Values::NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::NONE) { $this->options['areaCode'] = $areaCode; $this->options['contains'] = $contains; $this->options['smsEnabled'] = $smsEnabled; $this->options['mmsEnabled'] = $mmsEnabled; $this->options['voiceEnabled'] = $voiceEnabled; $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; $this->options['beta'] = $beta; $this->options['nearNumber'] = $nearNumber; $this->options['nearLatLong'] = $nearLatLong; $this->options['distance'] = $distance; $this->options['inPostalCode'] = $inPostalCode; $this->options['inRegion'] = $inRegion; $this->options['inRateCenter'] = $inRateCenter; $this->options['inLata'] = $inLata; $this->options['inLocality'] = $inLocality; $this->options['faxEnabled'] = $faxEnabled; } /** * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * * @param int $areaCode The area code of the phone numbers to read * @return $this Fluent Builder */ public function setAreaCode(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 * @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 * @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 * @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. * @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 * @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 * @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 * @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 new to the Twilio platform * @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. (US/Canada only) * @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. (US/Canada only) * @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. * (US/Canada only) * @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. * (US/Canada only) * @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. (US/Canada * only) * @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. (US/Canada only) * @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. (US/Canada only) * @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 * @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 * @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 . ']'; } } Api/V2010/Account/AvailablePhoneNumberCountry/VoipInstance.php 0000644 00000006030 15107452334 0020106 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $friendlyName * @property string $phoneNumber * @property string $lata * @property string $locality * @property string $rateCenter * @property string $latitude * @property string $longitude * @property string $region * @property string $postalCode * @property string $isoCountry * @property string $addressRequirements * @property bool $beta * @property string $capabilities */ class VoipInstance extends InstanceResource { /** * Initialize the VoipInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The account_sid * @param string $countryCode The ISO-3166-1 country code of the country. */ public function __construct(Version $version, array $payload, string $accountSid, string $countryCode) { parent::__construct($version); // Marshaled Properties $this->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' => 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]'; } } Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostInstance.php 0000644 00000006052 15107452334 0021234 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $friendlyName * @property string $phoneNumber * @property string $lata * @property string $locality * @property string $rateCenter * @property string $latitude * @property string $longitude * @property string $region * @property string $postalCode * @property string $isoCountry * @property string $addressRequirements * @property bool $beta * @property string $capabilities */ class SharedCostInstance extends InstanceResource { /** * Initialize the SharedCostInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The account_sid * @param string $countryCode The ISO-3166-1 country code of the country. */ public function __construct(Version $version, array $payload, string $accountSid, string $countryCode) { parent::__construct($version); // Marshaled Properties $this->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' => 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]'; } } Api/V2010/Account/AvailablePhoneNumberCountry/MobileOptions.php 0000644 00000040753 15107452334 0020301 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Options; use Twilio\Values; abstract class MobileOptions { /** * @param int $areaCode The area code of the phone numbers to read * @param string $contains The pattern on which to match phone numbers * @param bool $smsEnabled Whether the phone numbers can receive text messages * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages * @param bool $voiceEnabled Whether the phone numbers can receive calls. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that * require an Address * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers * that require a local address * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers * that require a foreign address * @param bool $beta Whether to read phone numbers new to the Twilio platform * @param string $nearNumber Given a phone number, find a geographically close * number within distance miles. (US/Canada only) * @param string $nearLatLong Given a latitude/longitude pair lat,long find * geographically close numbers within distance * miles. (US/Canada only) * @param int $distance The search radius, in miles, for a near_ query. * (US/Canada only) * @param string $inPostalCode Limit results to a particular postal code. * (US/Canada only) * @param string $inRegion Limit results to a particular region. (US/Canada * only) * @param string $inRateCenter Limit results to a specific rate center, or * given a phone number search within the same rate * center as that number. (US/Canada only) * @param string $inLata Limit results to a specific local access and transport * area. (US/Canada only) * @param string $inLocality Limit results to a particular locality * @param bool $faxEnabled Whether the phone numbers can receive faxes * @return ReadMobileOptions Options builder */ public static function read(int $areaCode = Values::NONE, string $contains = Values::NONE, bool $smsEnabled = Values::NONE, bool $mmsEnabled = Values::NONE, bool $voiceEnabled = Values::NONE, bool $excludeAllAddressRequired = Values::NONE, bool $excludeLocalAddressRequired = Values::NONE, bool $excludeForeignAddressRequired = Values::NONE, bool $beta = Values::NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::NONE): ReadMobileOptions { return new ReadMobileOptions($areaCode, $contains, $smsEnabled, $mmsEnabled, $voiceEnabled, $excludeAllAddressRequired, $excludeLocalAddressRequired, $excludeForeignAddressRequired, $beta, $nearNumber, $nearLatLong, $distance, $inPostalCode, $inRegion, $inRateCenter, $inLata, $inLocality, $faxEnabled); } } class ReadMobileOptions extends Options { /** * @param int $areaCode The area code of the phone numbers to read * @param string $contains The pattern on which to match phone numbers * @param bool $smsEnabled Whether the phone numbers can receive text messages * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages * @param bool $voiceEnabled Whether the phone numbers can receive calls. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that * require an Address * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers * that require a local address * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers * that require a foreign address * @param bool $beta Whether to read phone numbers new to the Twilio platform * @param string $nearNumber Given a phone number, find a geographically close * number within distance miles. (US/Canada only) * @param string $nearLatLong Given a latitude/longitude pair lat,long find * geographically close numbers within distance * miles. (US/Canada only) * @param int $distance The search radius, in miles, for a near_ query. * (US/Canada only) * @param string $inPostalCode Limit results to a particular postal code. * (US/Canada only) * @param string $inRegion Limit results to a particular region. (US/Canada * only) * @param string $inRateCenter Limit results to a specific rate center, or * given a phone number search within the same rate * center as that number. (US/Canada only) * @param string $inLata Limit results to a specific local access and transport * area. (US/Canada only) * @param string $inLocality Limit results to a particular locality * @param bool $faxEnabled Whether the phone numbers can receive faxes */ public function __construct(int $areaCode = Values::NONE, string $contains = Values::NONE, bool $smsEnabled = Values::NONE, bool $mmsEnabled = Values::NONE, bool $voiceEnabled = Values::NONE, bool $excludeAllAddressRequired = Values::NONE, bool $excludeLocalAddressRequired = Values::NONE, bool $excludeForeignAddressRequired = Values::NONE, bool $beta = Values::NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::NONE) { $this->options['areaCode'] = $areaCode; $this->options['contains'] = $contains; $this->options['smsEnabled'] = $smsEnabled; $this->options['mmsEnabled'] = $mmsEnabled; $this->options['voiceEnabled'] = $voiceEnabled; $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; $this->options['beta'] = $beta; $this->options['nearNumber'] = $nearNumber; $this->options['nearLatLong'] = $nearLatLong; $this->options['distance'] = $distance; $this->options['inPostalCode'] = $inPostalCode; $this->options['inRegion'] = $inRegion; $this->options['inRateCenter'] = $inRateCenter; $this->options['inLata'] = $inLata; $this->options['inLocality'] = $inLocality; $this->options['faxEnabled'] = $faxEnabled; } /** * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * * @param int $areaCode The area code of the phone numbers to read * @return $this Fluent Builder */ public function setAreaCode(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 * @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 * @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 * @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. * @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 * @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 * @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 * @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 new to the Twilio platform * @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. (US/Canada only) * @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. (US/Canada only) * @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. * (US/Canada only) * @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. * (US/Canada only) * @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. (US/Canada * only) * @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. (US/Canada only) * @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. (US/Canada only) * @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 * @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 * @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 . ']'; } } Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineList.php 0000644 00000014532 15107452334 0021502 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class MachineToMachineList extends ListResource { /** * Construct the MachineToMachineList * * @param Version $version Version that contains the resource * @param string $accountSid The account_sid * @param string $countryCode The ISO-3166-1 country code of the country. */ public function __construct(Version $version, string $accountSid, string $countryCode) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/AvailablePhoneNumbers/' . \rawurlencode($countryCode) . '/MachineToMachine.json'; } /** * Streams MachineToMachineInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of MachineToMachineInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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]'; } } Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeInstance.php 0000644 00000006044 15107452334 0020712 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $friendlyName * @property string $phoneNumber * @property string $lata * @property string $locality * @property string $rateCenter * @property string $latitude * @property string $longitude * @property string $region * @property string $postalCode * @property string $isoCountry * @property string $addressRequirements * @property bool $beta * @property string $capabilities */ class TollFreeInstance extends InstanceResource { /** * Initialize the TollFreeInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The account_sid * @param string $countryCode The ISO-3166-1 country code of the country. */ public function __construct(Version $version, array $payload, string $accountSid, string $countryCode) { parent::__construct($version); // Marshaled Properties $this->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' => 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]'; } } Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostList.php 0000644 00000014364 15107452334 0020410 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class SharedCostList extends ListResource { /** * Construct the SharedCostList * * @param Version $version Version that contains the resource * @param string $accountSid The account_sid * @param string $countryCode The ISO-3166-1 country code of the country. */ public function __construct(Version $version, string $accountSid, string $countryCode) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/AvailablePhoneNumbers/' . \rawurlencode($countryCode) . '/SharedCost.json'; } /** * Streams SharedCostInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of SharedCostInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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]'; } } Api/V2010/Account/AvailablePhoneNumberCountry/MobileInstance.php 0000644 00000006036 15107452334 0020406 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $friendlyName * @property string $phoneNumber * @property string $lata * @property string $locality * @property string $rateCenter * @property string $latitude * @property string $longitude * @property string $region * @property string $postalCode * @property string $isoCountry * @property string $addressRequirements * @property bool $beta * @property string $capabilities */ class MobileInstance extends InstanceResource { /** * Initialize the MobileInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The account_sid * @param string $countryCode The ISO-3166-1 country code of the country. */ public function __construct(Version $version, array $payload, string $accountSid, string $countryCode) { parent::__construct($version); // Marshaled Properties $this->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' => 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]'; } } Api/V2010/Account/AvailablePhoneNumberCountry/NationalList.php 0000644 00000014322 15107452334 0020110 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class NationalList extends ListResource { /** * Construct the NationalList * * @param Version $version Version that contains the resource * @param string $accountSid The account_sid * @param string $countryCode The ISO-3166-1 country code of the country. */ public function __construct(Version $version, string $accountSid, string $countryCode) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/AvailablePhoneNumbers/' . \rawurlencode($countryCode) . '/National.json'; } /** * Streams NationalInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of NationalInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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]'; } } Api/V2010/Account/AvailablePhoneNumberCountry/LocalOptions.php 0000644 00000041052 15107452334 0020115 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Options; use Twilio\Values; abstract class LocalOptions { /** * @param int $areaCode The area code of the phone numbers to read * @param string $contains The pattern on which to match phone numbers * @param bool $smsEnabled Whether the phone numbers can receive text messages * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages * @param bool $voiceEnabled Whether the phone numbers can receive calls. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that * require an Address * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers * that require a local address * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers * that require a foreign address * @param bool $beta Whether to read phone numbers new to the Twilio platform * @param string $nearNumber Given a phone number, find a geographically close * number within distance miles. (US/Canada only) * @param string $nearLatLong Given a latitude/longitude pair lat,long find * geographically close numbers within distance * miles. (US/Canada only) * @param int $distance The search radius, in miles, for a near_ query. * (US/Canada only) * @param string $inPostalCode Limit results to a particular postal code. * (US/Canada only) * @param string $inRegion Limit results to a particular region. (US/Canada * only) * @param string $inRateCenter Limit results to a specific rate center, or * given a phone number search within the same rate * center as that number. (US/Canada only) * @param string $inLata Limit results to a specific local access and transport * area. (US/Canada only) * @param string $inLocality Limit results to a particular locality * @param bool $faxEnabled Whether the phone numbers can receive faxes * @return ReadLocalOptions Options builder */ public static function read(int $areaCode = Values::NONE, string $contains = Values::NONE, bool $smsEnabled = Values::NONE, bool $mmsEnabled = Values::NONE, bool $voiceEnabled = Values::NONE, bool $excludeAllAddressRequired = Values::NONE, bool $excludeLocalAddressRequired = Values::NONE, bool $excludeForeignAddressRequired = Values::NONE, bool $beta = Values::NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::NONE): ReadLocalOptions { return new ReadLocalOptions($areaCode, $contains, $smsEnabled, $mmsEnabled, $voiceEnabled, $excludeAllAddressRequired, $excludeLocalAddressRequired, $excludeForeignAddressRequired, $beta, $nearNumber, $nearLatLong, $distance, $inPostalCode, $inRegion, $inRateCenter, $inLata, $inLocality, $faxEnabled); } } class ReadLocalOptions extends Options { /** * @param int $areaCode The area code of the phone numbers to read * @param string $contains The pattern on which to match phone numbers * @param bool $smsEnabled Whether the phone numbers can receive text messages * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages * @param bool $voiceEnabled Whether the phone numbers can receive calls. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that * require an Address * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers * that require a local address * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers * that require a foreign address * @param bool $beta Whether to read phone numbers new to the Twilio platform * @param string $nearNumber Given a phone number, find a geographically close * number within distance miles. (US/Canada only) * @param string $nearLatLong Given a latitude/longitude pair lat,long find * geographically close numbers within distance * miles. (US/Canada only) * @param int $distance The search radius, in miles, for a near_ query. * (US/Canada only) * @param string $inPostalCode Limit results to a particular postal code. * (US/Canada only) * @param string $inRegion Limit results to a particular region. (US/Canada * only) * @param string $inRateCenter Limit results to a specific rate center, or * given a phone number search within the same rate * center as that number. (US/Canada only) * @param string $inLata Limit results to a specific local access and transport * area. (US/Canada only) * @param string $inLocality Limit results to a particular locality * @param bool $faxEnabled Whether the phone numbers can receive faxes */ public function __construct(int $areaCode = Values::NONE, string $contains = Values::NONE, bool $smsEnabled = Values::NONE, bool $mmsEnabled = Values::NONE, bool $voiceEnabled = Values::NONE, bool $excludeAllAddressRequired = Values::NONE, bool $excludeLocalAddressRequired = Values::NONE, bool $excludeForeignAddressRequired = Values::NONE, bool $beta = Values::NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::NONE) { $this->options['areaCode'] = $areaCode; $this->options['contains'] = $contains; $this->options['smsEnabled'] = $smsEnabled; $this->options['mmsEnabled'] = $mmsEnabled; $this->options['voiceEnabled'] = $voiceEnabled; $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; $this->options['beta'] = $beta; $this->options['nearNumber'] = $nearNumber; $this->options['nearLatLong'] = $nearLatLong; $this->options['distance'] = $distance; $this->options['inPostalCode'] = $inPostalCode; $this->options['inRegion'] = $inRegion; $this->options['inRateCenter'] = $inRateCenter; $this->options['inLata'] = $inLata; $this->options['inLocality'] = $inLocality; $this->options['faxEnabled'] = $faxEnabled; } /** * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * * @param int $areaCode The area code of the phone numbers to read * @return $this Fluent Builder */ public function setAreaCode(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 * @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 * @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 * @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. * @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 * @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 * @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 * @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 new to the Twilio platform * @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. (US/Canada only) * @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. (US/Canada only) * @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. * (US/Canada only) * @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. * (US/Canada only) * @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. (US/Canada * only) * @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. (US/Canada only) * @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. (US/Canada only) * @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 * @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 * @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 . ']'; } } Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostPage.php 0000644 00000002514 15107452334 0020343 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SharedCostPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/AvailablePhoneNumberCountry/VoipOptions.php 0000644 00000040737 15107452334 0020011 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Options; use Twilio\Values; abstract class VoipOptions { /** * @param int $areaCode The area code of the phone numbers to read * @param string $contains The pattern on which to match phone numbers * @param bool $smsEnabled Whether the phone numbers can receive text messages * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages * @param bool $voiceEnabled Whether the phone numbers can receive calls. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that * require an Address * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers * that require a local address * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers * that require a foreign address * @param bool $beta Whether to read phone numbers new to the Twilio platform * @param string $nearNumber Given a phone number, find a geographically close * number within distance miles. (US/Canada only) * @param string $nearLatLong Given a latitude/longitude pair lat,long find * geographically close numbers within distance * miles. (US/Canada only) * @param int $distance The search radius, in miles, for a near_ query. * (US/Canada only) * @param string $inPostalCode Limit results to a particular postal code. * (US/Canada only) * @param string $inRegion Limit results to a particular region. (US/Canada * only) * @param string $inRateCenter Limit results to a specific rate center, or * given a phone number search within the same rate * center as that number. (US/Canada only) * @param string $inLata Limit results to a specific local access and transport * area. (US/Canada only) * @param string $inLocality Limit results to a particular locality * @param bool $faxEnabled Whether the phone numbers can receive faxes * @return ReadVoipOptions Options builder */ public static function read(int $areaCode = Values::NONE, string $contains = Values::NONE, bool $smsEnabled = Values::NONE, bool $mmsEnabled = Values::NONE, bool $voiceEnabled = Values::NONE, bool $excludeAllAddressRequired = Values::NONE, bool $excludeLocalAddressRequired = Values::NONE, bool $excludeForeignAddressRequired = Values::NONE, bool $beta = Values::NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::NONE): ReadVoipOptions { return new ReadVoipOptions($areaCode, $contains, $smsEnabled, $mmsEnabled, $voiceEnabled, $excludeAllAddressRequired, $excludeLocalAddressRequired, $excludeForeignAddressRequired, $beta, $nearNumber, $nearLatLong, $distance, $inPostalCode, $inRegion, $inRateCenter, $inLata, $inLocality, $faxEnabled); } } class ReadVoipOptions extends Options { /** * @param int $areaCode The area code of the phone numbers to read * @param string $contains The pattern on which to match phone numbers * @param bool $smsEnabled Whether the phone numbers can receive text messages * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages * @param bool $voiceEnabled Whether the phone numbers can receive calls. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that * require an Address * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers * that require a local address * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers * that require a foreign address * @param bool $beta Whether to read phone numbers new to the Twilio platform * @param string $nearNumber Given a phone number, find a geographically close * number within distance miles. (US/Canada only) * @param string $nearLatLong Given a latitude/longitude pair lat,long find * geographically close numbers within distance * miles. (US/Canada only) * @param int $distance The search radius, in miles, for a near_ query. * (US/Canada only) * @param string $inPostalCode Limit results to a particular postal code. * (US/Canada only) * @param string $inRegion Limit results to a particular region. (US/Canada * only) * @param string $inRateCenter Limit results to a specific rate center, or * given a phone number search within the same rate * center as that number. (US/Canada only) * @param string $inLata Limit results to a specific local access and transport * area. (US/Canada only) * @param string $inLocality Limit results to a particular locality * @param bool $faxEnabled Whether the phone numbers can receive faxes */ public function __construct(int $areaCode = Values::NONE, string $contains = Values::NONE, bool $smsEnabled = Values::NONE, bool $mmsEnabled = Values::NONE, bool $voiceEnabled = Values::NONE, bool $excludeAllAddressRequired = Values::NONE, bool $excludeLocalAddressRequired = Values::NONE, bool $excludeForeignAddressRequired = Values::NONE, bool $beta = Values::NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::NONE) { $this->options['areaCode'] = $areaCode; $this->options['contains'] = $contains; $this->options['smsEnabled'] = $smsEnabled; $this->options['mmsEnabled'] = $mmsEnabled; $this->options['voiceEnabled'] = $voiceEnabled; $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; $this->options['beta'] = $beta; $this->options['nearNumber'] = $nearNumber; $this->options['nearLatLong'] = $nearLatLong; $this->options['distance'] = $distance; $this->options['inPostalCode'] = $inPostalCode; $this->options['inRegion'] = $inRegion; $this->options['inRateCenter'] = $inRateCenter; $this->options['inLata'] = $inLata; $this->options['inLocality'] = $inLocality; $this->options['faxEnabled'] = $faxEnabled; } /** * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * * @param int $areaCode The area code of the phone numbers to read * @return $this Fluent Builder */ public function setAreaCode(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 * @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 * @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 * @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. * @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 * @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 * @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 * @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 new to the Twilio platform * @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. (US/Canada only) * @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. (US/Canada only) * @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. * (US/Canada only) * @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. * (US/Canada only) * @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. (US/Canada * only) * @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. (US/Canada only) * @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. (US/Canada only) * @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 * @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 * @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 . ']'; } } Api/V2010/Account/AvailablePhoneNumberCountry/VoipPage.php 0000644 00000002450 15107452334 0017220 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class VoipPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/AvailablePhoneNumberCountry/NationalOptions.php 0000644 00000040767 15107452334 0020644 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Options; use Twilio\Values; abstract class NationalOptions { /** * @param int $areaCode The area code of the phone numbers to read * @param string $contains The pattern on which to match phone numbers * @param bool $smsEnabled Whether the phone numbers can receive text messages * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages * @param bool $voiceEnabled Whether the phone numbers can receive calls. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that * require an Address * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers * that require a local address * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers * that require a foreign address * @param bool $beta Whether to read phone numbers new to the Twilio platform * @param string $nearNumber Given a phone number, find a geographically close * number within distance miles. (US/Canada only) * @param string $nearLatLong Given a latitude/longitude pair lat,long find * geographically close numbers within distance * miles. (US/Canada only) * @param int $distance The search radius, in miles, for a near_ query. * (US/Canada only) * @param string $inPostalCode Limit results to a particular postal code. * (US/Canada only) * @param string $inRegion Limit results to a particular region. (US/Canada * only) * @param string $inRateCenter Limit results to a specific rate center, or * given a phone number search within the same rate * center as that number. (US/Canada only) * @param string $inLata Limit results to a specific local access and transport * area. (US/Canada only) * @param string $inLocality Limit results to a particular locality * @param bool $faxEnabled Whether the phone numbers can receive faxes * @return ReadNationalOptions Options builder */ public static function read(int $areaCode = Values::NONE, string $contains = Values::NONE, bool $smsEnabled = Values::NONE, bool $mmsEnabled = Values::NONE, bool $voiceEnabled = Values::NONE, bool $excludeAllAddressRequired = Values::NONE, bool $excludeLocalAddressRequired = Values::NONE, bool $excludeForeignAddressRequired = Values::NONE, bool $beta = Values::NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::NONE): ReadNationalOptions { return new ReadNationalOptions($areaCode, $contains, $smsEnabled, $mmsEnabled, $voiceEnabled, $excludeAllAddressRequired, $excludeLocalAddressRequired, $excludeForeignAddressRequired, $beta, $nearNumber, $nearLatLong, $distance, $inPostalCode, $inRegion, $inRateCenter, $inLata, $inLocality, $faxEnabled); } } class ReadNationalOptions extends Options { /** * @param int $areaCode The area code of the phone numbers to read * @param string $contains The pattern on which to match phone numbers * @param bool $smsEnabled Whether the phone numbers can receive text messages * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages * @param bool $voiceEnabled Whether the phone numbers can receive calls. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that * require an Address * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers * that require a local address * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers * that require a foreign address * @param bool $beta Whether to read phone numbers new to the Twilio platform * @param string $nearNumber Given a phone number, find a geographically close * number within distance miles. (US/Canada only) * @param string $nearLatLong Given a latitude/longitude pair lat,long find * geographically close numbers within distance * miles. (US/Canada only) * @param int $distance The search radius, in miles, for a near_ query. * (US/Canada only) * @param string $inPostalCode Limit results to a particular postal code. * (US/Canada only) * @param string $inRegion Limit results to a particular region. (US/Canada * only) * @param string $inRateCenter Limit results to a specific rate center, or * given a phone number search within the same rate * center as that number. (US/Canada only) * @param string $inLata Limit results to a specific local access and transport * area. (US/Canada only) * @param string $inLocality Limit results to a particular locality * @param bool $faxEnabled Whether the phone numbers can receive faxes */ public function __construct(int $areaCode = Values::NONE, string $contains = Values::NONE, bool $smsEnabled = Values::NONE, bool $mmsEnabled = Values::NONE, bool $voiceEnabled = Values::NONE, bool $excludeAllAddressRequired = Values::NONE, bool $excludeLocalAddressRequired = Values::NONE, bool $excludeForeignAddressRequired = Values::NONE, bool $beta = Values::NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::NONE) { $this->options['areaCode'] = $areaCode; $this->options['contains'] = $contains; $this->options['smsEnabled'] = $smsEnabled; $this->options['mmsEnabled'] = $mmsEnabled; $this->options['voiceEnabled'] = $voiceEnabled; $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; $this->options['beta'] = $beta; $this->options['nearNumber'] = $nearNumber; $this->options['nearLatLong'] = $nearLatLong; $this->options['distance'] = $distance; $this->options['inPostalCode'] = $inPostalCode; $this->options['inRegion'] = $inRegion; $this->options['inRateCenter'] = $inRateCenter; $this->options['inLata'] = $inLata; $this->options['inLocality'] = $inLocality; $this->options['faxEnabled'] = $faxEnabled; } /** * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * * @param int $areaCode The area code of the phone numbers to read * @return $this Fluent Builder */ public function setAreaCode(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 * @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 * @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 * @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. * @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 * @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 * @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 * @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 new to the Twilio platform * @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. (US/Canada only) * @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. (US/Canada only) * @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. * (US/Canada only) * @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. * (US/Canada only) * @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. (US/Canada * only) * @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. (US/Canada only) * @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. (US/Canada only) * @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 * @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 * @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 . ']'; } } Api/V2010/Account/AvailablePhoneNumberCountry/MobilePage.php 0000644 00000002464 15107452334 0017517 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MobilePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineInstance.php 0000644 00000006074 15107452334 0022335 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $friendlyName * @property string $phoneNumber * @property string $lata * @property string $locality * @property string $rateCenter * @property string $latitude * @property string $longitude * @property string $region * @property string $postalCode * @property string $isoCountry * @property string $addressRequirements * @property bool $beta * @property string $capabilities */ class MachineToMachineInstance extends InstanceResource { /** * Initialize the MachineToMachineInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The account_sid * @param string $countryCode The ISO-3166-1 country code of the country. */ public function __construct(Version $version, array $payload, string $accountSid, string $countryCode) { parent::__construct($version); // Marshaled Properties $this->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' => 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]'; } } Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeList.php 0000644 00000014322 15107452334 0020057 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class TollFreeList extends ListResource { /** * Construct the TollFreeList * * @param Version $version Version that contains the resource * @param string $accountSid The account_sid * @param string $countryCode The ISO-3166-1 country code of the country. */ public function __construct(Version $version, string $accountSid, string $countryCode) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/AvailablePhoneNumbers/' . \rawurlencode($countryCode) . '/TollFree.json'; } /** * Streams TollFreeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of TollFreeInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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]'; } } Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeOptions.php 0000644 00000040767 15107452334 0020613 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Options; use Twilio\Values; abstract class TollFreeOptions { /** * @param int $areaCode The area code of the phone numbers to read * @param string $contains The pattern on which to match phone numbers * @param bool $smsEnabled Whether the phone numbers can receive text messages * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages * @param bool $voiceEnabled Whether the phone numbers can receive calls. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that * require an Address * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers * that require a local address * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers * that require a foreign address * @param bool $beta Whether to read phone numbers new to the Twilio platform * @param string $nearNumber Given a phone number, find a geographically close * number within distance miles. (US/Canada only) * @param string $nearLatLong Given a latitude/longitude pair lat,long find * geographically close numbers within distance * miles. (US/Canada only) * @param int $distance The search radius, in miles, for a near_ query. * (US/Canada only) * @param string $inPostalCode Limit results to a particular postal code. * (US/Canada only) * @param string $inRegion Limit results to a particular region. (US/Canada * only) * @param string $inRateCenter Limit results to a specific rate center, or * given a phone number search within the same rate * center as that number. (US/Canada only) * @param string $inLata Limit results to a specific local access and transport * area. (US/Canada only) * @param string $inLocality Limit results to a particular locality * @param bool $faxEnabled Whether the phone numbers can receive faxes * @return ReadTollFreeOptions Options builder */ public static function read(int $areaCode = Values::NONE, string $contains = Values::NONE, bool $smsEnabled = Values::NONE, bool $mmsEnabled = Values::NONE, bool $voiceEnabled = Values::NONE, bool $excludeAllAddressRequired = Values::NONE, bool $excludeLocalAddressRequired = Values::NONE, bool $excludeForeignAddressRequired = Values::NONE, bool $beta = Values::NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::NONE): ReadTollFreeOptions { return new ReadTollFreeOptions($areaCode, $contains, $smsEnabled, $mmsEnabled, $voiceEnabled, $excludeAllAddressRequired, $excludeLocalAddressRequired, $excludeForeignAddressRequired, $beta, $nearNumber, $nearLatLong, $distance, $inPostalCode, $inRegion, $inRateCenter, $inLata, $inLocality, $faxEnabled); } } class ReadTollFreeOptions extends Options { /** * @param int $areaCode The area code of the phone numbers to read * @param string $contains The pattern on which to match phone numbers * @param bool $smsEnabled Whether the phone numbers can receive text messages * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages * @param bool $voiceEnabled Whether the phone numbers can receive calls. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that * require an Address * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers * that require a local address * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers * that require a foreign address * @param bool $beta Whether to read phone numbers new to the Twilio platform * @param string $nearNumber Given a phone number, find a geographically close * number within distance miles. (US/Canada only) * @param string $nearLatLong Given a latitude/longitude pair lat,long find * geographically close numbers within distance * miles. (US/Canada only) * @param int $distance The search radius, in miles, for a near_ query. * (US/Canada only) * @param string $inPostalCode Limit results to a particular postal code. * (US/Canada only) * @param string $inRegion Limit results to a particular region. (US/Canada * only) * @param string $inRateCenter Limit results to a specific rate center, or * given a phone number search within the same rate * center as that number. (US/Canada only) * @param string $inLata Limit results to a specific local access and transport * area. (US/Canada only) * @param string $inLocality Limit results to a particular locality * @param bool $faxEnabled Whether the phone numbers can receive faxes */ public function __construct(int $areaCode = Values::NONE, string $contains = Values::NONE, bool $smsEnabled = Values::NONE, bool $mmsEnabled = Values::NONE, bool $voiceEnabled = Values::NONE, bool $excludeAllAddressRequired = Values::NONE, bool $excludeLocalAddressRequired = Values::NONE, bool $excludeForeignAddressRequired = Values::NONE, bool $beta = Values::NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::NONE) { $this->options['areaCode'] = $areaCode; $this->options['contains'] = $contains; $this->options['smsEnabled'] = $smsEnabled; $this->options['mmsEnabled'] = $mmsEnabled; $this->options['voiceEnabled'] = $voiceEnabled; $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; $this->options['beta'] = $beta; $this->options['nearNumber'] = $nearNumber; $this->options['nearLatLong'] = $nearLatLong; $this->options['distance'] = $distance; $this->options['inPostalCode'] = $inPostalCode; $this->options['inRegion'] = $inRegion; $this->options['inRateCenter'] = $inRateCenter; $this->options['inLata'] = $inLata; $this->options['inLocality'] = $inLocality; $this->options['faxEnabled'] = $faxEnabled; } /** * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * * @param int $areaCode The area code of the phone numbers to read * @return $this Fluent Builder */ public function setAreaCode(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 * @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 * @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 * @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. * @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 * @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 * @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 * @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 new to the Twilio platform * @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. (US/Canada only) * @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. (US/Canada only) * @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. * (US/Canada only) * @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. * (US/Canada only) * @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. (US/Canada * only) * @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. (US/Canada only) * @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. (US/Canada only) * @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 * @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 * @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 . ']'; } } Api/V2010/Account/ConnectAppContext.php 0000644 00000006431 15107452334 0013501 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class ConnectAppContext extends InstanceContext { /** * Initialize the ConnectAppContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/ConnectApps/' . \rawurlencode($sid) . '.json'; } /** * Fetch the ConnectAppInstance * * @return ConnectAppInstance Fetched ConnectAppInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ConnectAppInstance { $payload = $this->version->fetch('GET', $this->uri); 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' => Serialize::map($options['permissions'], function($e) { return $e; }), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ConnectAppInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Delete the ConnectAppInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Api/V2010/Account/NewKeyPage.php 0000644 00000002242 15107452334 0012075 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class NewKeyPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Call/UserDefinedMessageList.php 0000644 00000004014 15107452334 0015306 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class UserDefinedMessageList extends ListResource { /** * Construct the UserDefinedMessageList * * @param Version $version Version that contains the resource * @param string $accountSid Account SID. * @param string $callSid Call SID. */ public function __construct(Version $version, string $accountSid, string $callSid) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); 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]'; } } Api/V2010/Account/Call/FeedbackContext.php 0000644 00000006663 15107452334 0014015 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class FeedbackContext extends InstanceContext { /** * Initialize the FeedbackContext * * @param Version $version Version that contains the resource * @param string $accountSid The unique sid that identifies this account * @param string $callSid The call sid that uniquely identifies the call */ public function __construct(Version $version, $accountSid, $callSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Calls/' . \rawurlencode($callSid) . '/Feedback.json'; } /** * Fetch the FeedbackInstance * * @return FeedbackInstance Fetched FeedbackInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FeedbackInstance { $payload = $this->version->fetch('GET', $this->uri); return new FeedbackInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['callSid'] ); } /** * Create the FeedbackInstance * * @param int $qualityScore The call quality expressed as an integer from 1 to 5 * @param array|Options $options Optional Arguments * @return FeedbackInstance Created FeedbackInstance * @throws TwilioException When an HTTP error occurs. */ public function create(int $qualityScore, array $options = []): FeedbackInstance { $options = new Values($options); $data = Values::of([ 'QualityScore' => $qualityScore, 'Issue' => Serialize::map($options['issue'], function($e) { return $e; }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new FeedbackInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['callSid'] ); } /** * Update the FeedbackInstance * * @param array|Options $options Optional Arguments * @return FeedbackInstance Updated FeedbackInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): FeedbackInstance { $options = new Values($options); $data = Values::of([ 'QualityScore' => $options['qualityScore'], 'Issue' => Serialize::map($options['issue'], function($e) { return $e; }), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new FeedbackInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['callSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.FeedbackContext ' . \implode(' ', $context) . ']'; } } Api/V2010/Account/Call/SiprecPage.php 0000644 00000002402 15107452334 0012771 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SiprecPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Call/SiprecList.php 0000644 00000035400 15107452334 0013034 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class SiprecList extends ListResource { /** * Construct the SiprecList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created this resource * @param string $callSid The SID of the Call the resource is associated with */ public function __construct(Version $version, string $accountSid, string $callSid) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); 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` */ 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]'; } } Api/V2010/Account/Call/FeedbackPage.php 0000644 00000002416 15107452334 0013235 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class FeedbackPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return FeedbackInstance \Twilio\Rest\Api\V2010\Account\Call\FeedbackInstance */ public function buildInstance(array $payload): FeedbackInstance { return new FeedbackInstance( $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.FeedbackPage]'; } } Api/V2010/Account/Call/UserDefinedMessageSubscriptionOptions.php 0000644 00000005362 15107452334 0020442 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Options; use Twilio\Values; abstract class UserDefinedMessageSubscriptionOptions { /** * @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. * @param string $method HTTP method used with the callback. * @return CreateUserDefinedMessageSubscriptionOptions Options builder */ public static function create(string $idempotencyKey = Values::NONE, string $method = Values::NONE): CreateUserDefinedMessageSubscriptionOptions { return new CreateUserDefinedMessageSubscriptionOptions($idempotencyKey, $method); } } class CreateUserDefinedMessageSubscriptionOptions extends Options { /** * @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. * @param string $method HTTP method used with the callback. */ public function __construct(string $idempotencyKey = Values::NONE, string $method = Values::NONE) { $this->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 HTTP method used with the callback. * @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 . ']'; } } Api/V2010/Account/Call/NotificationList.php 0000644 00000013317 15107452334 0014240 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class NotificationList extends ListResource { /** * Construct the NotificationList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @param string $callSid The SID of the Call the resource is associated with */ public function __construct(Version $version, string $accountSid, string $callSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Calls/' . \rawurlencode($callSid) . '/Notifications.json'; } /** * Streams NotificationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of NotificationInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 unique string that identifies the resource */ 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]'; } } Api/V2010/Account/Call/UserDefinedMessageSubscriptionInstance.php 0000644 00000007116 15107452334 0020552 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $callSid * @property string $sid * @property \DateTime $dateCreated * @property string $uri */ class UserDefinedMessageSubscriptionInstance extends InstanceResource { /** * Initialize the UserDefinedMessageSubscriptionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid Account SID. * @param string $callSid Call SID. * @param string $sid User Defined Message Subscription SID. */ public function __construct(Version $version, array $payload, string $accountSid, string $callSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Api/V2010/Account/Call/RecordingList.php 0000644 00000015357 15107452334 0013534 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class RecordingList extends ListResource { /** * Construct the RecordingList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @param string $callSid The SID of the Call the resource is associated with */ public function __construct(Version $version, string $accountSid, string $callSid) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new RecordingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['callSid'] ); } /** * Streams RecordingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of RecordingInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 unique string that identifies the resource */ 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]'; } } Api/V2010/Account/Call/EventList.php 0000644 00000011067 15107452334 0012673 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class EventList extends ListResource { /** * Construct the EventList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created this resource * @param string $callSid The unique string that identifies this resource */ public function __construct(Version $version, string $accountSid, string $callSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Calls/' . \rawurlencode($callSid) . '/Events.json'; } /** * 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']); } /** * 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); } /** * 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]'; } } Api/V2010/Account/Call/PaymentInstance.php 0000644 00000010626 15107452334 0014060 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $callSid * @property string $sid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $uri */ class PaymentInstance extends InstanceResource { /** * Initialize the PaymentInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the Payments * resource. * @param string $callSid The SID of the Call the resource is associated with. * @param string $sid The SID of Payments session */ public function __construct(Version $version, array $payload, string $accountSid, string $callSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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. * @param string $statusCallback Provide an absolute or relative URL to receive * status updates regarding your Pay session. * @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) . ']'; } } Api/V2010/Account/Call/NotificationPage.php 0000644 00000002446 15107452334 0014202 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class NotificationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Call/RecordingOptions.php 0000644 00000030400 15107452334 0014236 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Options; use Twilio\Values; abstract class RecordingOptions { /** * @param string[] $recordingStatusCallbackEvent The recording status changes * that should generate a callback * @param string $recordingStatusCallback The callback URL on each selected * recording event * @param string $recordingStatusCallbackMethod The HTTP method we should use * to call * `recording_status_callback` * @param string $trim Whether to trim the silence in the recording * @param string $recordingChannels The number of channels that the output * recording will be configured with * @param string $recordingTrack Which track(s) to record * @return CreateRecordingOptions Options builder */ public static function create(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): CreateRecordingOptions { return new CreateRecordingOptions($recordingStatusCallbackEvent, $recordingStatusCallback, $recordingStatusCallbackMethod, $trim, $recordingChannels, $recordingTrack); } /** * @param string $pauseBehavior Whether to record or not during the pause * period. * @return UpdateRecordingOptions Options builder */ public static function update(string $pauseBehavior = Values::NONE): UpdateRecordingOptions { return new UpdateRecordingOptions($pauseBehavior); } /** * @param string $dateCreatedBefore The `YYYY-MM-DD` value of the resources to * read * @param string $dateCreated The `YYYY-MM-DD` value of the resources to read * @param string $dateCreatedAfter The `YYYY-MM-DD` value of the resources to * read * @return ReadRecordingOptions Options builder */ public static function read(string $dateCreatedBefore = Values::NONE, string $dateCreated = Values::NONE, string $dateCreatedAfter = Values::NONE): ReadRecordingOptions { return new ReadRecordingOptions($dateCreatedBefore, $dateCreated, $dateCreatedAfter); } } class CreateRecordingOptions extends Options { /** * @param string[] $recordingStatusCallbackEvent The recording status changes * that should generate a callback * @param string $recordingStatusCallback The callback URL on each selected * recording event * @param string $recordingStatusCallbackMethod The HTTP method we should use * to call * `recording_status_callback` * @param string $trim Whether to trim the silence in the recording * @param string $recordingChannels The number of channels that the output * recording will be configured with * @param string $recordingTrack Which track(s) to record */ 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 changes * that should generate a callback * @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 callback URL on each selected * recording event * @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` * @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 the silence in the recording * @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 that the output * recording will be configured with * @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 Which track(s) to record * @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 UpdateRecordingOptions extends Options { /** * @param string $pauseBehavior Whether to record or not during the pause * period. */ 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 or not during the pause * period. * @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 . ']'; } } class ReadRecordingOptions extends Options { /** * @param string $dateCreatedBefore The `YYYY-MM-DD` value of the resources to * read * @param string $dateCreated The `YYYY-MM-DD` value of the resources to read * @param string $dateCreatedAfter The `YYYY-MM-DD` value of the resources to * read */ public function __construct(string $dateCreatedBefore = Values::NONE, string $dateCreated = Values::NONE, string $dateCreatedAfter = Values::NONE) { $this->options['dateCreatedBefore'] = $dateCreatedBefore; $this->options['dateCreated'] = $dateCreated; $this->options['dateCreatedAfter'] = $dateCreatedAfter; } /** * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * * @param string $dateCreatedBefore The `YYYY-MM-DD` value of the resources to * read * @return $this Fluent Builder */ public function setDateCreatedBefore(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 `YYYY-MM-DD` value of the resources to read * @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 `YYYY-MM-DD` value of the resources to * read * @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 . ']'; } } Api/V2010/Account/Call/PaymentList.php 0000644 00000007472 15107452334 0013234 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class PaymentList extends ListResource { /** * Construct the PaymentList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the Payments * resource. * @param string $callSid The SID of the Call the resource is associated with. */ public function __construct(Version $version, string $accountSid, string $callSid) { parent::__construct($version); // Path Solution $this->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. * @param string $statusCallback Provide an absolute or relative URL to receive * status updates regarding your Pay session.. * @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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new PaymentInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['callSid'] ); } /** * Constructs a PaymentContext * * @param string $sid The SID of Payments session */ 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]'; } } Api/V2010/Account/Call/UserDefinedMessageOptions.php 0000644 00000004107 15107452334 0016031 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Options; use Twilio\Values; abstract class UserDefinedMessageOptions { /** * @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 CreateUserDefinedMessageOptions Options builder */ public static function create(string $idempotencyKey = Values::NONE): CreateUserDefinedMessageOptions { return new CreateUserDefinedMessageOptions($idempotencyKey); } } class CreateUserDefinedMessageOptions extends Options { /** * @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. */ public function __construct(string $idempotencyKey = Values::NONE) { $this->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 . ']'; } } Api/V2010/Account/Call/RecordingContext.php 0000644 00000006070 15107452334 0014235 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class RecordingContext extends InstanceContext { /** * Initialize the RecordingContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $callSid The Call SID of the resource to fetch * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $accountSid, $callSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Calls/' . \rawurlencode($callSid) . '/Recordings/' . \rawurlencode($sid) . '.json'; } /** * Update the RecordingInstance * * @param string $status The new status of the recording * @param array|Options $options Optional Arguments * @return RecordingInstance Updated RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status, array $options = []): RecordingInstance { $options = new Values($options); $data = Values::of(['Status' => $status, 'PauseBehavior' => $options['pauseBehavior'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new RecordingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['callSid'], $this->solution['sid'] ); } /** * Fetch the RecordingInstance * * @return RecordingInstance Fetched RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RecordingInstance { $payload = $this->version->fetch('GET', $this->uri); return new RecordingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['callSid'], $this->solution['sid'] ); } /** * Delete the RecordingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Api/V2010/Account/Call/EventPage.php 0000644 00000002374 15107452334 0012635 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class EventPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Call/FeedbackSummaryList.php 0000644 00000005056 15107452334 0014655 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class FeedbackSummaryList extends ListResource { /** * Construct the FeedbackSummaryList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created this resource */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Calls/FeedbackSummary.json'; } /** * Create the FeedbackSummaryInstance * * @param \DateTime $startDate Only include feedback given on or after this date * @param \DateTime $endDate Only include feedback given on or before this date * @param array|Options $options Optional Arguments * @return FeedbackSummaryInstance Created FeedbackSummaryInstance * @throws TwilioException When an HTTP error occurs. */ public function create(\DateTime $startDate, \DateTime $endDate, array $options = []): FeedbackSummaryInstance { $options = new Values($options); $data = Values::of([ 'StartDate' => Serialize::iso8601Date($startDate), 'EndDate' => Serialize::iso8601Date($endDate), 'IncludeSubaccounts' => Serialize::booleanToString($options['includeSubaccounts']), 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new FeedbackSummaryInstance($this->version, $payload, $this->solution['accountSid']); } /** * Constructs a FeedbackSummaryContext * * @param string $sid A string that uniquely identifies this feedback summary * resource */ public function getContext(string $sid): FeedbackSummaryContext { return new FeedbackSummaryContext($this->version, $this->solution['accountSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.FeedbackSummaryList]'; } } Api/V2010/Account/Call/StreamPage.php 0000644 00000002402 15107452335 0013000 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class StreamPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Call/StreamContext.php 0000644 00000004071 15107452335 0013554 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class StreamContext extends InstanceContext { /** * Initialize the StreamContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created this resource * @param string $callSid The SID of the Call the resource is associated with * @param string $sid The SID of the Stream resource, or the `name` */ public function __construct(Version $version, $accountSid, $callSid, $sid) { parent::__construct($version); // Path Solution $this->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 The status. Must have the value `stopped` * @return StreamInstance Updated StreamInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status): StreamInstance { $data = Values::of(['Status' => $status, ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } Api/V2010/Account/Call/StreamInstance.php 0000644 00000007275 15107452335 0013705 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $callSid * @property string $name * @property string $status * @property \DateTime $dateUpdated * @property string $uri */ class StreamInstance extends InstanceResource { /** * Initialize the StreamInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created this resource * @param string $callSid The SID of the Call the resource is associated with * @param string $sid The SID of the Stream resource, or the `name` */ public function __construct(Version $version, array $payload, string $accountSid, string $callSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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 The status. Must have the value `stopped` * @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) . ']'; } } Api/V2010/Account/Call/RecordingInstance.php 0000644 00000012752 15107452335 0014362 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property string $callSid * @property string $conferenceSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property \DateTime $startTime * @property string $duration * @property string $sid * @property string $price * @property string $uri * @property array $encryptionDetails * @property string $priceUnit * @property string $status * @property int $channels * @property string $source * @property int $errorCode * @property string $track */ class RecordingInstance extends InstanceResource { /** * Initialize the RecordingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $callSid The SID of the Call the resource is associated with * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $accountSid, string $callSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Update the RecordingInstance * * @param string $status The new status of the recording * @param array|Options $options Optional Arguments * @return RecordingInstance Updated RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status, array $options = []): RecordingInstance { return $this->proxy()->update($status, $options); } /** * Fetch the RecordingInstance * * @return RecordingInstance Fetched RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RecordingInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Api/V2010/Account/Call/NotificationInstance.php 0000644 00000011436 15107452335 0015072 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property string $callSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $errorCode * @property string $log * @property \DateTime $messageDate * @property string $messageText * @property string $moreInfo * @property string $requestMethod * @property string $requestUrl * @property string $requestVariables * @property string $responseBody * @property string $responseHeaders * @property string $sid * @property string $uri */ class NotificationInstance extends InstanceResource { /** * Initialize the NotificationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $callSid The SID of the Call the resource is associated with * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $accountSid, string $callSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Api/V2010/Account/Call/NotificationOptions.php 0000644 00000007373 15107452335 0014766 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Options; use Twilio\Values; abstract class NotificationOptions { /** * @param int $log Filter by log level * @param string $messageDateBefore Filter by date * @param string $messageDate Filter by date * @param string $messageDateAfter Filter by date * @return ReadNotificationOptions Options builder */ public static function read(int $log = Values::NONE, string $messageDateBefore = Values::NONE, string $messageDate = Values::NONE, string $messageDateAfter = Values::NONE): ReadNotificationOptions { return new ReadNotificationOptions($log, $messageDateBefore, $messageDate, $messageDateAfter); } } class ReadNotificationOptions extends Options { /** * @param int $log Filter by log level * @param string $messageDateBefore Filter by date * @param string $messageDate Filter by date * @param string $messageDateAfter Filter by date */ public function __construct(int $log = Values::NONE, string $messageDateBefore = Values::NONE, string $messageDate = Values::NONE, string $messageDateAfter = Values::NONE) { $this->options['log'] = $log; $this->options['messageDateBefore'] = $messageDateBefore; $this->options['messageDate'] = $messageDate; $this->options['messageDateAfter'] = $messageDateAfter; } /** * Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read. * * @param int $log Filter by log level * @return $this Fluent Builder */ public function setLog(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 Filter by 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 Filter by 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 Filter by 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 . ']'; } } Api/V2010/Account/Call/UserDefinedMessageSubscriptionPage.php 0000644 00000002622 15107452335 0017660 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UserDefinedMessageSubscriptionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Call/SiprecInstance.php 0000644 00000007275 15107452335 0013677 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $callSid * @property string $name * @property string $status * @property \DateTime $dateUpdated * @property string $uri */ class SiprecInstance extends InstanceResource { /** * Initialize the SiprecInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created this resource * @param string $callSid The SID of the Call the resource is associated with * @param string $sid The SID of the Siprec resource, or the `name` */ public function __construct(Version $version, array $payload, string $accountSid, string $callSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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 The status. Must have the value `stopped` * @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) . ']'; } } Api/V2010/Account/Call/RecordingPage.php 0000644 00000002424 15107452335 0013465 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RecordingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Call/PaymentPage.php 0000644 00000002723 15107452335 0013170 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class PaymentPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Call/FeedbackSummaryOptions.php 0000644 00000007303 15107452335 0015373 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Options; use Twilio\Values; abstract class FeedbackSummaryOptions { /** * @param bool $includeSubaccounts `true` includes feedback from the specified * account and its subaccounts * @param string $statusCallback The URL that we will request when the feedback * summary is complete * @param string $statusCallbackMethod The HTTP method we use to make requests * to the StatusCallback URL * @return CreateFeedbackSummaryOptions Options builder */ public static function create(bool $includeSubaccounts = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE): CreateFeedbackSummaryOptions { return new CreateFeedbackSummaryOptions($includeSubaccounts, $statusCallback, $statusCallbackMethod); } } class CreateFeedbackSummaryOptions extends Options { /** * @param bool $includeSubaccounts `true` includes feedback from the specified * account and its subaccounts * @param string $statusCallback The URL that we will request when the feedback * summary is complete * @param string $statusCallbackMethod The HTTP method we use to make requests * to the StatusCallback URL */ public function __construct(bool $includeSubaccounts = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE) { $this->options['includeSubaccounts'] = $includeSubaccounts; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; } /** * Whether to also include Feedback resources from all subaccounts. `true` includes feedback from all subaccounts and `false`, the default, includes feedback from only the specified account. * * @param bool $includeSubaccounts `true` includes feedback from the specified * account and its subaccounts * @return $this Fluent Builder */ public function setIncludeSubaccounts(bool $includeSubaccounts): self { $this->options['includeSubaccounts'] = $includeSubaccounts; return $this; } /** * The URL that we will request when the feedback summary is complete. * * @param string $statusCallback The URL that we will request when the feedback * summary is complete * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method (`GET` or `POST`) we use to make the request to the `StatusCallback` URL. * * @param string $statusCallbackMethod The HTTP method we use to make requests * to the StatusCallback URL * @return $this Fluent Builder */ public function setStatusCallbackMethod(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.CreateFeedbackSummaryOptions ' . $options . ']'; } } Api/V2010/Account/Call/StreamList.php 0000644 00000035475 15107452335 0013057 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class StreamList extends ListResource { /** * Construct the StreamList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created this resource * @param string $callSid The SID of the Call the resource is associated with */ public function __construct(Version $version, string $accountSid, string $callSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Calls/' . \rawurlencode($callSid) . '/Streams.json'; } /** * Create the StreamInstance * * @param string $url 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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new StreamInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['callSid'] ); } /** * Constructs a StreamContext * * @param string $sid The SID of the Stream resource, or the `name` */ 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]'; } } Api/V2010/Account/Call/FeedbackInstance.php 0000644 00000010307 15107452335 0014124 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string[] $issues * @property int $qualityScore * @property string $sid */ class FeedbackInstance extends InstanceResource { /** * Initialize the FeedbackInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The unique sid that identifies this account * @param string $callSid The unique string that identifies this resource */ public function __construct(Version $version, array $payload, string $accountSid, string $callSid) { parent::__construct($version); // Marshaled Properties $this->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')), 'issues' => Values::array_get($payload, 'issues'), 'qualityScore' => Values::array_get($payload, 'quality_score'), 'sid' => Values::array_get($payload, 'sid'), ]; $this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return FeedbackContext Context for this FeedbackInstance */ protected function proxy(): FeedbackContext { if (!$this->context) { $this->context = new FeedbackContext( $this->version, $this->solution['accountSid'], $this->solution['callSid'] ); } return $this->context; } /** * Fetch the FeedbackInstance * * @return FeedbackInstance Fetched FeedbackInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FeedbackInstance { return $this->proxy()->fetch(); } /** * Create the FeedbackInstance * * @param int $qualityScore The call quality expressed as an integer from 1 to 5 * @param array|Options $options Optional Arguments * @return FeedbackInstance Created FeedbackInstance * @throws TwilioException When an HTTP error occurs. */ public function create(int $qualityScore, array $options = []): FeedbackInstance { return $this->proxy()->create($qualityScore, $options); } /** * Update the FeedbackInstance * * @param array|Options $options Optional Arguments * @return FeedbackInstance Updated FeedbackInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): FeedbackInstance { 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.FeedbackInstance ' . \implode(' ', $context) . ']'; } } Api/V2010/Account/Call/PaymentContext.php 0000644 00000005757 15107452335 0013752 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class PaymentContext extends InstanceContext { /** * Initialize the PaymentContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that will update the * resource * @param string $callSid The SID of the call that will create the resource. * @param string $sid The SID of Payments session */ public function __construct(Version $version, $accountSid, $callSid, $sid) { parent::__construct($version); // Path Solution $this->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. * @param string $statusCallback Provide an absolute or relative URL to receive * status updates regarding your Pay session. * @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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } Api/V2010/Account/Call/EventInstance.php 0000644 00000003655 15107452335 0013531 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property array $request * @property array $response */ class EventInstance extends InstanceResource { /** * Initialize the EventInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created this resource * @param string $callSid The unique string that identifies this resource */ public function __construct(Version $version, array $payload, string $accountSid, string $callSid) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Api/V2010/Account/Call/FeedbackList.php 0000644 00000002353 15107452335 0013275 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\ListResource; use Twilio\Version; class FeedbackList extends ListResource { /** * Construct the FeedbackList * * @param Version $version Version that contains the resource * @param string $accountSid The unique sid that identifies this account * @param string $callSid The unique string that identifies this resource */ public function __construct(Version $version, string $accountSid, string $callSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, ]; } /** * Constructs a FeedbackContext */ public function getContext(): FeedbackContext { return new FeedbackContext( $this->version, $this->solution['accountSid'], $this->solution['callSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.FeedbackList]'; } } Api/V2010/Account/Call/PaymentOptions.php 0000644 00000043060 15107452335 0013746 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class PaymentOptions { /** * @param string $bankAccountType Type of bank account if payment source is ACH. * @param string $chargeAmount A positive decimal value less than 1,000,000 to * charge against the credit card or bank account. * @param string $currency The currency of the `charge_amount`. * @param string $description The description can be used to provide more * details regarding the transaction. * @param string $input A list of inputs that should be accepted. Currently * only `dtmf` is supported. * @param int $minPostalCodeLength A positive integer that is used to validate * the length of the `PostalCode` inputted by * the user. * @param array $parameter A single-level JSON object used to pass custom * parameters to payment processors. (Required for ACH * payments) * @param string $paymentConnector This is the unique name corresponding to the * Pay Connector installed in the Twilio * Add-ons. * @param string $paymentMethod Type of payment being captured. * @param bool $postalCode Indicates whether the credit card PostalCode (zip * code) is a required piece of payment information * that must be provided by the caller. * @param bool $securityCode Indicates whether the credit card security code is * a required piece of payment information that must * be provided by the caller. * @param int $timeout The number of seconds that <Pay> 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. * @param string $tokenType Indicates whether the payment method should be * tokenized as a `one-time` or `reusable` token. * @param string $validCardTypes Credit card types separated by space that Pay * should accept. * @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::NONE, array $parameter = Values::ARRAY_NONE, string $paymentConnector = Values::NONE, string $paymentMethod = Values::NONE, bool $postalCode = Values::NONE, bool $securityCode = Values::NONE, int $timeout = Values::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 The piece of payment information that you wish the * caller to enter. * @param string $status Indicates whether the current payment session should * be cancelled or completed. * @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 Type of bank account if payment source is ACH. * @param string $chargeAmount A positive decimal value less than 1,000,000 to * charge against the credit card or bank account. * @param string $currency The currency of the `charge_amount`. * @param string $description The description can be used to provide more * details regarding the transaction. * @param string $input A list of inputs that should be accepted. Currently * only `dtmf` is supported. * @param int $minPostalCodeLength A positive integer that is used to validate * the length of the `PostalCode` inputted by * the user. * @param array $parameter A single-level JSON object used to pass custom * parameters to payment processors. (Required for ACH * payments) * @param string $paymentConnector This is the unique name corresponding to the * Pay Connector installed in the Twilio * Add-ons. * @param string $paymentMethod Type of payment being captured. * @param bool $postalCode Indicates whether the credit card PostalCode (zip * code) is a required piece of payment information * that must be provided by the caller. * @param bool $securityCode Indicates whether the credit card security code is * a required piece of payment information that must * be provided by the caller. * @param int $timeout The number of seconds that <Pay> 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. * @param string $tokenType Indicates whether the payment method should be * tokenized as a `one-time` or `reusable` token. * @param string $validCardTypes Credit card types separated by space that Pay * should accept. */ 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::NONE, array $parameter = Values::ARRAY_NONE, string $paymentConnector = Values::NONE, string $paymentMethod = Values::NONE, bool $postalCode = Values::NONE, bool $securityCode = Values::NONE, int $timeout = Values::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; } /** * Type of bank account if payment source is ACH. One of `consumer-checking`, `consumer-savings`, or `commercial-checking`. The default value is `consumer-checking`. * * @param string $bankAccountType Type of bank account if payment source is ACH. * @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. * @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`. * @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. * @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. * @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. * @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 <Pay> 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) * @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 [<Pay> 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. * @return $this Fluent Builder */ public function setPaymentConnector(string $paymentConnector): self { $this->options['paymentConnector'] = $paymentConnector; return $this; } /** * Type of payment being captured. One of `credit-card` or `ach-debit`. The default value is `credit-card`. * * @param string $paymentMethod Type of payment being captured. * @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 PostalCode (zip * code) is a required piece of payment information * that must be provided by the caller. * @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. * @return $this Fluent Builder */ public function setSecurityCode(bool $securityCode): self { $this->options['securityCode'] = $securityCode; return $this; } /** * The number of seconds that <Pay> 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 <Pay> 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. * @return $this Fluent Builder */ public function setTimeout(int $timeout): self { $this->options['timeout'] = $timeout; return $this; } /** * Indicates whether the payment method should be tokenized as a `one-time` or `reusable` token. The default value is `reusable`. Do not enter a charge amount when tokenizing. If a charge amount is entered, the payment method will be charged and not tokenized. * * @param string $tokenType Indicates whether the payment method should be * tokenized as a `one-time` or `reusable` token. * @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. * @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 The piece of payment information that you wish the * caller to enter. * @param string $status Indicates whether the current payment session should * be cancelled or completed. */ public function __construct(string $capture = Values::NONE, string $status = Values::NONE) { $this->options['capture'] = $capture; $this->options['status'] = $status; } /** * The piece of payment information that you wish the caller to enter. Must be one of `payment-card-number`, `expiration-date`, `security-code`, `postal-code`, `bank-routing-number`, or `bank-account-number`. * * @param string $capture The piece of payment information that you wish the * caller to enter. * @return $this Fluent Builder */ public function setCapture(string $capture): self { $this->options['capture'] = $capture; return $this; } /** * Indicates whether the current payment session should be cancelled or completed. When `cancel` the payment session is cancelled. When `complete`, Twilio sends the payment information to the selected Pay Connector for processing. * * @param string $status Indicates whether the current payment session should * be cancelled 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.UpdatePaymentOptions ' . $options . ']'; } } Api/V2010/Account/Call/UserDefinedMessageSubscriptionContext.php 0000644 00000003327 15107452335 0020433 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Version; class UserDefinedMessageSubscriptionContext extends InstanceContext { /** * Initialize the UserDefinedMessageSubscriptionContext * * @param Version $version Version that contains the resource * @param string $accountSid Account SID. * @param string $callSid Call SID. * @param string $sid User Defined Message Subscription SID. */ public function __construct(Version $version, $accountSid, $callSid, $sid) { parent::__construct($version); // Path Solution $this->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 { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Api/V2010/Account/Call/UserDefinedMessageInstance.php 0000644 00000004202 15107452335 0016137 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $callSid * @property string $sid * @property \DateTime $dateCreated */ class UserDefinedMessageInstance extends InstanceResource { /** * Initialize the UserDefinedMessageInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid Account SID. * @param string $callSid Call SID. */ public function __construct(Version $version, array $payload, string $accountSid, string $callSid) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Api/V2010/Account/Call/FeedbackSummaryContext.php 0000644 00000004174 15107452335 0015367 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class FeedbackSummaryContext extends InstanceContext { /** * Initialize the FeedbackSummaryContext * * @param Version $version Version that contains the resource * @param string $accountSid The unique sid that identifies this account * @param string $sid A string that uniquely identifies this feedback summary * resource */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Calls/FeedbackSummary/' . \rawurlencode($sid) . '.json'; } /** * Fetch the FeedbackSummaryInstance * * @return FeedbackSummaryInstance Fetched FeedbackSummaryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FeedbackSummaryInstance { $payload = $this->version->fetch('GET', $this->uri); return new FeedbackSummaryInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Delete the FeedbackSummaryInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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.FeedbackSummaryContext ' . \implode(' ', $context) . ']'; } } Api/V2010/Account/Call/StreamOptions.php 0000644 00000343014 15107452335 0013566 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Options; use Twilio\Values; abstract class StreamOptions { /** * @param string $name The name of this resource * @param string $track One of `inbound_track`, `outbound_track`, `both_tracks`. * @param string $statusCallback Absolute URL of the status callback. * @param string $statusCallbackMethod The http method for the status_callback. * @param string $parameter1Name Parameter name * @param string $parameter1Value Parameter value * @param string $parameter2Name Parameter name * @param string $parameter2Value Parameter value * @param string $parameter3Name Parameter name * @param string $parameter3Value Parameter value * @param string $parameter4Name Parameter name * @param string $parameter4Value Parameter value * @param string $parameter5Name Parameter name * @param string $parameter5Value Parameter value * @param string $parameter6Name Parameter name * @param string $parameter6Value Parameter value * @param string $parameter7Name Parameter name * @param string $parameter7Value Parameter value * @param string $parameter8Name Parameter name * @param string $parameter8Value Parameter value * @param string $parameter9Name Parameter name * @param string $parameter9Value Parameter value * @param string $parameter10Name Parameter name * @param string $parameter10Value Parameter value * @param string $parameter11Name Parameter name * @param string $parameter11Value Parameter value * @param string $parameter12Name Parameter name * @param string $parameter12Value Parameter value * @param string $parameter13Name Parameter name * @param string $parameter13Value Parameter value * @param string $parameter14Name Parameter name * @param string $parameter14Value Parameter value * @param string $parameter15Name Parameter name * @param string $parameter15Value Parameter value * @param string $parameter16Name Parameter name * @param string $parameter16Value Parameter value * @param string $parameter17Name Parameter name * @param string $parameter17Value Parameter value * @param string $parameter18Name Parameter name * @param string $parameter18Value Parameter value * @param string $parameter19Name Parameter name * @param string $parameter19Value Parameter value * @param string $parameter20Name Parameter name * @param string $parameter20Value Parameter value * @param string $parameter21Name Parameter name * @param string $parameter21Value Parameter value * @param string $parameter22Name Parameter name * @param string $parameter22Value Parameter value * @param string $parameter23Name Parameter name * @param string $parameter23Value Parameter value * @param string $parameter24Name Parameter name * @param string $parameter24Value Parameter value * @param string $parameter25Name Parameter name * @param string $parameter25Value Parameter value * @param string $parameter26Name Parameter name * @param string $parameter26Value Parameter value * @param string $parameter27Name Parameter name * @param string $parameter27Value Parameter value * @param string $parameter28Name Parameter name * @param string $parameter28Value Parameter value * @param string $parameter29Name Parameter name * @param string $parameter29Value Parameter value * @param string $parameter30Name Parameter name * @param string $parameter30Value Parameter value * @param string $parameter31Name Parameter name * @param string $parameter31Value Parameter value * @param string $parameter32Name Parameter name * @param string $parameter32Value Parameter value * @param string $parameter33Name Parameter name * @param string $parameter33Value Parameter value * @param string $parameter34Name Parameter name * @param string $parameter34Value Parameter value * @param string $parameter35Name Parameter name * @param string $parameter35Value Parameter value * @param string $parameter36Name Parameter name * @param string $parameter36Value Parameter value * @param string $parameter37Name Parameter name * @param string $parameter37Value Parameter value * @param string $parameter38Name Parameter name * @param string $parameter38Value Parameter value * @param string $parameter39Name Parameter name * @param string $parameter39Value Parameter value * @param string $parameter40Name Parameter name * @param string $parameter40Value Parameter value * @param string $parameter41Name Parameter name * @param string $parameter41Value Parameter value * @param string $parameter42Name Parameter name * @param string $parameter42Value Parameter value * @param string $parameter43Name Parameter name * @param string $parameter43Value Parameter value * @param string $parameter44Name Parameter name * @param string $parameter44Value Parameter value * @param string $parameter45Name Parameter name * @param string $parameter45Value Parameter value * @param string $parameter46Name Parameter name * @param string $parameter46Value Parameter value * @param string $parameter47Name Parameter name * @param string $parameter47Value Parameter value * @param string $parameter48Name Parameter name * @param string $parameter48Value Parameter value * @param string $parameter49Name Parameter name * @param string $parameter49Value Parameter value * @param string $parameter50Name Parameter name * @param string $parameter50Value Parameter value * @param string $parameter51Name Parameter name * @param string $parameter51Value Parameter value * @param string $parameter52Name Parameter name * @param string $parameter52Value Parameter value * @param string $parameter53Name Parameter name * @param string $parameter53Value Parameter value * @param string $parameter54Name Parameter name * @param string $parameter54Value Parameter value * @param string $parameter55Name Parameter name * @param string $parameter55Value Parameter value * @param string $parameter56Name Parameter name * @param string $parameter56Value Parameter value * @param string $parameter57Name Parameter name * @param string $parameter57Value Parameter value * @param string $parameter58Name Parameter name * @param string $parameter58Value Parameter value * @param string $parameter59Name Parameter name * @param string $parameter59Value Parameter value * @param string $parameter60Name Parameter name * @param string $parameter60Value Parameter value * @param string $parameter61Name Parameter name * @param string $parameter61Value Parameter value * @param string $parameter62Name Parameter name * @param string $parameter62Value Parameter value * @param string $parameter63Name Parameter name * @param string $parameter63Value Parameter value * @param string $parameter64Name Parameter name * @param string $parameter64Value Parameter value * @param string $parameter65Name Parameter name * @param string $parameter65Value Parameter value * @param string $parameter66Name Parameter name * @param string $parameter66Value Parameter value * @param string $parameter67Name Parameter name * @param string $parameter67Value Parameter value * @param string $parameter68Name Parameter name * @param string $parameter68Value Parameter value * @param string $parameter69Name Parameter name * @param string $parameter69Value Parameter value * @param string $parameter70Name Parameter name * @param string $parameter70Value Parameter value * @param string $parameter71Name Parameter name * @param string $parameter71Value Parameter value * @param string $parameter72Name Parameter name * @param string $parameter72Value Parameter value * @param string $parameter73Name Parameter name * @param string $parameter73Value Parameter value * @param string $parameter74Name Parameter name * @param string $parameter74Value Parameter value * @param string $parameter75Name Parameter name * @param string $parameter75Value Parameter value * @param string $parameter76Name Parameter name * @param string $parameter76Value Parameter value * @param string $parameter77Name Parameter name * @param string $parameter77Value Parameter value * @param string $parameter78Name Parameter name * @param string $parameter78Value Parameter value * @param string $parameter79Name Parameter name * @param string $parameter79Value Parameter value * @param string $parameter80Name Parameter name * @param string $parameter80Value Parameter value * @param string $parameter81Name Parameter name * @param string $parameter81Value Parameter value * @param string $parameter82Name Parameter name * @param string $parameter82Value Parameter value * @param string $parameter83Name Parameter name * @param string $parameter83Value Parameter value * @param string $parameter84Name Parameter name * @param string $parameter84Value Parameter value * @param string $parameter85Name Parameter name * @param string $parameter85Value Parameter value * @param string $parameter86Name Parameter name * @param string $parameter86Value Parameter value * @param string $parameter87Name Parameter name * @param string $parameter87Value Parameter value * @param string $parameter88Name Parameter name * @param string $parameter88Value Parameter value * @param string $parameter89Name Parameter name * @param string $parameter89Value Parameter value * @param string $parameter90Name Parameter name * @param string $parameter90Value Parameter value * @param string $parameter91Name Parameter name * @param string $parameter91Value Parameter value * @param string $parameter92Name Parameter name * @param string $parameter92Value Parameter value * @param string $parameter93Name Parameter name * @param string $parameter93Value Parameter value * @param string $parameter94Name Parameter name * @param string $parameter94Value Parameter value * @param string $parameter95Name Parameter name * @param string $parameter95Value Parameter value * @param string $parameter96Name Parameter name * @param string $parameter96Value Parameter value * @param string $parameter97Name Parameter name * @param string $parameter97Value Parameter value * @param string $parameter98Name Parameter name * @param string $parameter98Value Parameter value * @param string $parameter99Name Parameter name * @param string $parameter99Value Parameter value * @return CreateStreamOptions Options builder */ public static function create(string $name = Values::NONE, string $track = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, string $parameter1Name = Values::NONE, string $parameter1Value = Values::NONE, string $parameter2Name = Values::NONE, string $parameter2Value = Values::NONE, string $parameter3Name = Values::NONE, string $parameter3Value = Values::NONE, string $parameter4Name = Values::NONE, string $parameter4Value = Values::NONE, string $parameter5Name = Values::NONE, string $parameter5Value = Values::NONE, string $parameter6Name = Values::NONE, string $parameter6Value = Values::NONE, string $parameter7Name = Values::NONE, string $parameter7Value = Values::NONE, string $parameter8Name = Values::NONE, string $parameter8Value = Values::NONE, string $parameter9Name = Values::NONE, string $parameter9Value = Values::NONE, string $parameter10Name = Values::NONE, string $parameter10Value = Values::NONE, string $parameter11Name = Values::NONE, string $parameter11Value = Values::NONE, string $parameter12Name = Values::NONE, string $parameter12Value = Values::NONE, string $parameter13Name = Values::NONE, string $parameter13Value = Values::NONE, string $parameter14Name = Values::NONE, string $parameter14Value = Values::NONE, string $parameter15Name = Values::NONE, string $parameter15Value = Values::NONE, string $parameter16Name = Values::NONE, string $parameter16Value = Values::NONE, string $parameter17Name = Values::NONE, string $parameter17Value = Values::NONE, string $parameter18Name = Values::NONE, string $parameter18Value = Values::NONE, string $parameter19Name = Values::NONE, string $parameter19Value = Values::NONE, string $parameter20Name = Values::NONE, string $parameter20Value = Values::NONE, string $parameter21Name = Values::NONE, string $parameter21Value = Values::NONE, string $parameter22Name = Values::NONE, string $parameter22Value = Values::NONE, string $parameter23Name = Values::NONE, string $parameter23Value = Values::NONE, string $parameter24Name = Values::NONE, string $parameter24Value = Values::NONE, string $parameter25Name = Values::NONE, string $parameter25Value = Values::NONE, string $parameter26Name = Values::NONE, string $parameter26Value = Values::NONE, string $parameter27Name = Values::NONE, string $parameter27Value = Values::NONE, string $parameter28Name = Values::NONE, string $parameter28Value = Values::NONE, string $parameter29Name = Values::NONE, string $parameter29Value = Values::NONE, string $parameter30Name = Values::NONE, string $parameter30Value = Values::NONE, string $parameter31Name = Values::NONE, string $parameter31Value = Values::NONE, string $parameter32Name = Values::NONE, string $parameter32Value = Values::NONE, string $parameter33Name = Values::NONE, string $parameter33Value = Values::NONE, string $parameter34Name = Values::NONE, string $parameter34Value = Values::NONE, string $parameter35Name = Values::NONE, string $parameter35Value = Values::NONE, string $parameter36Name = Values::NONE, string $parameter36Value = Values::NONE, string $parameter37Name = Values::NONE, string $parameter37Value = Values::NONE, string $parameter38Name = Values::NONE, string $parameter38Value = Values::NONE, string $parameter39Name = Values::NONE, string $parameter39Value = Values::NONE, string $parameter40Name = Values::NONE, string $parameter40Value = Values::NONE, string $parameter41Name = Values::NONE, string $parameter41Value = Values::NONE, string $parameter42Name = Values::NONE, string $parameter42Value = Values::NONE, string $parameter43Name = Values::NONE, string $parameter43Value = Values::NONE, string $parameter44Name = Values::NONE, string $parameter44Value = Values::NONE, string $parameter45Name = Values::NONE, string $parameter45Value = Values::NONE, string $parameter46Name = Values::NONE, string $parameter46Value = Values::NONE, string $parameter47Name = Values::NONE, string $parameter47Value = Values::NONE, string $parameter48Name = Values::NONE, string $parameter48Value = Values::NONE, string $parameter49Name = Values::NONE, string $parameter49Value = Values::NONE, string $parameter50Name = Values::NONE, string $parameter50Value = Values::NONE, string $parameter51Name = Values::NONE, string $parameter51Value = Values::NONE, string $parameter52Name = Values::NONE, string $parameter52Value = Values::NONE, string $parameter53Name = Values::NONE, string $parameter53Value = Values::NONE, string $parameter54Name = Values::NONE, string $parameter54Value = Values::NONE, string $parameter55Name = Values::NONE, string $parameter55Value = Values::NONE, string $parameter56Name = Values::NONE, string $parameter56Value = Values::NONE, string $parameter57Name = Values::NONE, string $parameter57Value = Values::NONE, string $parameter58Name = Values::NONE, string $parameter58Value = Values::NONE, string $parameter59Name = Values::NONE, string $parameter59Value = Values::NONE, string $parameter60Name = Values::NONE, string $parameter60Value = Values::NONE, string $parameter61Name = Values::NONE, string $parameter61Value = Values::NONE, string $parameter62Name = Values::NONE, string $parameter62Value = Values::NONE, string $parameter63Name = Values::NONE, string $parameter63Value = Values::NONE, string $parameter64Name = Values::NONE, string $parameter64Value = Values::NONE, string $parameter65Name = Values::NONE, string $parameter65Value = Values::NONE, string $parameter66Name = Values::NONE, string $parameter66Value = Values::NONE, string $parameter67Name = Values::NONE, string $parameter67Value = Values::NONE, string $parameter68Name = Values::NONE, string $parameter68Value = Values::NONE, string $parameter69Name = Values::NONE, string $parameter69Value = Values::NONE, string $parameter70Name = Values::NONE, string $parameter70Value = Values::NONE, string $parameter71Name = Values::NONE, string $parameter71Value = Values::NONE, string $parameter72Name = Values::NONE, string $parameter72Value = Values::NONE, string $parameter73Name = Values::NONE, string $parameter73Value = Values::NONE, string $parameter74Name = Values::NONE, string $parameter74Value = Values::NONE, string $parameter75Name = Values::NONE, string $parameter75Value = Values::NONE, string $parameter76Name = Values::NONE, string $parameter76Value = Values::NONE, string $parameter77Name = Values::NONE, string $parameter77Value = Values::NONE, string $parameter78Name = Values::NONE, string $parameter78Value = Values::NONE, string $parameter79Name = Values::NONE, string $parameter79Value = Values::NONE, string $parameter80Name = Values::NONE, string $parameter80Value = Values::NONE, string $parameter81Name = Values::NONE, string $parameter81Value = Values::NONE, string $parameter82Name = Values::NONE, string $parameter82Value = Values::NONE, string $parameter83Name = Values::NONE, string $parameter83Value = Values::NONE, string $parameter84Name = Values::NONE, string $parameter84Value = Values::NONE, string $parameter85Name = Values::NONE, string $parameter85Value = Values::NONE, string $parameter86Name = Values::NONE, string $parameter86Value = Values::NONE, string $parameter87Name = Values::NONE, string $parameter87Value = Values::NONE, string $parameter88Name = Values::NONE, string $parameter88Value = Values::NONE, string $parameter89Name = Values::NONE, string $parameter89Value = Values::NONE, string $parameter90Name = Values::NONE, string $parameter90Value = Values::NONE, string $parameter91Name = Values::NONE, string $parameter91Value = Values::NONE, string $parameter92Name = Values::NONE, string $parameter92Value = Values::NONE, string $parameter93Name = Values::NONE, string $parameter93Value = Values::NONE, string $parameter94Name = Values::NONE, string $parameter94Value = Values::NONE, string $parameter95Name = Values::NONE, string $parameter95Value = Values::NONE, string $parameter96Name = Values::NONE, string $parameter96Value = Values::NONE, string $parameter97Name = Values::NONE, string $parameter97Value = Values::NONE, string $parameter98Name = Values::NONE, string $parameter98Value = Values::NONE, string $parameter99Name = Values::NONE, string $parameter99Value = Values::NONE): CreateStreamOptions { return new CreateStreamOptions($name, $track, $statusCallback, $statusCallbackMethod, $parameter1Name, $parameter1Value, $parameter2Name, $parameter2Value, $parameter3Name, $parameter3Value, $parameter4Name, $parameter4Value, $parameter5Name, $parameter5Value, $parameter6Name, $parameter6Value, $parameter7Name, $parameter7Value, $parameter8Name, $parameter8Value, $parameter9Name, $parameter9Value, $parameter10Name, $parameter10Value, $parameter11Name, $parameter11Value, $parameter12Name, $parameter12Value, $parameter13Name, $parameter13Value, $parameter14Name, $parameter14Value, $parameter15Name, $parameter15Value, $parameter16Name, $parameter16Value, $parameter17Name, $parameter17Value, $parameter18Name, $parameter18Value, $parameter19Name, $parameter19Value, $parameter20Name, $parameter20Value, $parameter21Name, $parameter21Value, $parameter22Name, $parameter22Value, $parameter23Name, $parameter23Value, $parameter24Name, $parameter24Value, $parameter25Name, $parameter25Value, $parameter26Name, $parameter26Value, $parameter27Name, $parameter27Value, $parameter28Name, $parameter28Value, $parameter29Name, $parameter29Value, $parameter30Name, $parameter30Value, $parameter31Name, $parameter31Value, $parameter32Name, $parameter32Value, $parameter33Name, $parameter33Value, $parameter34Name, $parameter34Value, $parameter35Name, $parameter35Value, $parameter36Name, $parameter36Value, $parameter37Name, $parameter37Value, $parameter38Name, $parameter38Value, $parameter39Name, $parameter39Value, $parameter40Name, $parameter40Value, $parameter41Name, $parameter41Value, $parameter42Name, $parameter42Value, $parameter43Name, $parameter43Value, $parameter44Name, $parameter44Value, $parameter45Name, $parameter45Value, $parameter46Name, $parameter46Value, $parameter47Name, $parameter47Value, $parameter48Name, $parameter48Value, $parameter49Name, $parameter49Value, $parameter50Name, $parameter50Value, $parameter51Name, $parameter51Value, $parameter52Name, $parameter52Value, $parameter53Name, $parameter53Value, $parameter54Name, $parameter54Value, $parameter55Name, $parameter55Value, $parameter56Name, $parameter56Value, $parameter57Name, $parameter57Value, $parameter58Name, $parameter58Value, $parameter59Name, $parameter59Value, $parameter60Name, $parameter60Value, $parameter61Name, $parameter61Value, $parameter62Name, $parameter62Value, $parameter63Name, $parameter63Value, $parameter64Name, $parameter64Value, $parameter65Name, $parameter65Value, $parameter66Name, $parameter66Value, $parameter67Name, $parameter67Value, $parameter68Name, $parameter68Value, $parameter69Name, $parameter69Value, $parameter70Name, $parameter70Value, $parameter71Name, $parameter71Value, $parameter72Name, $parameter72Value, $parameter73Name, $parameter73Value, $parameter74Name, $parameter74Value, $parameter75Name, $parameter75Value, $parameter76Name, $parameter76Value, $parameter77Name, $parameter77Value, $parameter78Name, $parameter78Value, $parameter79Name, $parameter79Value, $parameter80Name, $parameter80Value, $parameter81Name, $parameter81Value, $parameter82Name, $parameter82Value, $parameter83Name, $parameter83Value, $parameter84Name, $parameter84Value, $parameter85Name, $parameter85Value, $parameter86Name, $parameter86Value, $parameter87Name, $parameter87Value, $parameter88Name, $parameter88Value, $parameter89Name, $parameter89Value, $parameter90Name, $parameter90Value, $parameter91Name, $parameter91Value, $parameter92Name, $parameter92Value, $parameter93Name, $parameter93Value, $parameter94Name, $parameter94Value, $parameter95Name, $parameter95Value, $parameter96Name, $parameter96Value, $parameter97Name, $parameter97Value, $parameter98Name, $parameter98Value, $parameter99Name, $parameter99Value); } } class CreateStreamOptions extends Options { /** * @param string $name The name of this resource * @param string $track One of `inbound_track`, `outbound_track`, `both_tracks`. * @param string $statusCallback Absolute URL of the status callback. * @param string $statusCallbackMethod The http method for the status_callback. * @param string $parameter1Name Parameter name * @param string $parameter1Value Parameter value * @param string $parameter2Name Parameter name * @param string $parameter2Value Parameter value * @param string $parameter3Name Parameter name * @param string $parameter3Value Parameter value * @param string $parameter4Name Parameter name * @param string $parameter4Value Parameter value * @param string $parameter5Name Parameter name * @param string $parameter5Value Parameter value * @param string $parameter6Name Parameter name * @param string $parameter6Value Parameter value * @param string $parameter7Name Parameter name * @param string $parameter7Value Parameter value * @param string $parameter8Name Parameter name * @param string $parameter8Value Parameter value * @param string $parameter9Name Parameter name * @param string $parameter9Value Parameter value * @param string $parameter10Name Parameter name * @param string $parameter10Value Parameter value * @param string $parameter11Name Parameter name * @param string $parameter11Value Parameter value * @param string $parameter12Name Parameter name * @param string $parameter12Value Parameter value * @param string $parameter13Name Parameter name * @param string $parameter13Value Parameter value * @param string $parameter14Name Parameter name * @param string $parameter14Value Parameter value * @param string $parameter15Name Parameter name * @param string $parameter15Value Parameter value * @param string $parameter16Name Parameter name * @param string $parameter16Value Parameter value * @param string $parameter17Name Parameter name * @param string $parameter17Value Parameter value * @param string $parameter18Name Parameter name * @param string $parameter18Value Parameter value * @param string $parameter19Name Parameter name * @param string $parameter19Value Parameter value * @param string $parameter20Name Parameter name * @param string $parameter20Value Parameter value * @param string $parameter21Name Parameter name * @param string $parameter21Value Parameter value * @param string $parameter22Name Parameter name * @param string $parameter22Value Parameter value * @param string $parameter23Name Parameter name * @param string $parameter23Value Parameter value * @param string $parameter24Name Parameter name * @param string $parameter24Value Parameter value * @param string $parameter25Name Parameter name * @param string $parameter25Value Parameter value * @param string $parameter26Name Parameter name * @param string $parameter26Value Parameter value * @param string $parameter27Name Parameter name * @param string $parameter27Value Parameter value * @param string $parameter28Name Parameter name * @param string $parameter28Value Parameter value * @param string $parameter29Name Parameter name * @param string $parameter29Value Parameter value * @param string $parameter30Name Parameter name * @param string $parameter30Value Parameter value * @param string $parameter31Name Parameter name * @param string $parameter31Value Parameter value * @param string $parameter32Name Parameter name * @param string $parameter32Value Parameter value * @param string $parameter33Name Parameter name * @param string $parameter33Value Parameter value * @param string $parameter34Name Parameter name * @param string $parameter34Value Parameter value * @param string $parameter35Name Parameter name * @param string $parameter35Value Parameter value * @param string $parameter36Name Parameter name * @param string $parameter36Value Parameter value * @param string $parameter37Name Parameter name * @param string $parameter37Value Parameter value * @param string $parameter38Name Parameter name * @param string $parameter38Value Parameter value * @param string $parameter39Name Parameter name * @param string $parameter39Value Parameter value * @param string $parameter40Name Parameter name * @param string $parameter40Value Parameter value * @param string $parameter41Name Parameter name * @param string $parameter41Value Parameter value * @param string $parameter42Name Parameter name * @param string $parameter42Value Parameter value * @param string $parameter43Name Parameter name * @param string $parameter43Value Parameter value * @param string $parameter44Name Parameter name * @param string $parameter44Value Parameter value * @param string $parameter45Name Parameter name * @param string $parameter45Value Parameter value * @param string $parameter46Name Parameter name * @param string $parameter46Value Parameter value * @param string $parameter47Name Parameter name * @param string $parameter47Value Parameter value * @param string $parameter48Name Parameter name * @param string $parameter48Value Parameter value * @param string $parameter49Name Parameter name * @param string $parameter49Value Parameter value * @param string $parameter50Name Parameter name * @param string $parameter50Value Parameter value * @param string $parameter51Name Parameter name * @param string $parameter51Value Parameter value * @param string $parameter52Name Parameter name * @param string $parameter52Value Parameter value * @param string $parameter53Name Parameter name * @param string $parameter53Value Parameter value * @param string $parameter54Name Parameter name * @param string $parameter54Value Parameter value * @param string $parameter55Name Parameter name * @param string $parameter55Value Parameter value * @param string $parameter56Name Parameter name * @param string $parameter56Value Parameter value * @param string $parameter57Name Parameter name * @param string $parameter57Value Parameter value * @param string $parameter58Name Parameter name * @param string $parameter58Value Parameter value * @param string $parameter59Name Parameter name * @param string $parameter59Value Parameter value * @param string $parameter60Name Parameter name * @param string $parameter60Value Parameter value * @param string $parameter61Name Parameter name * @param string $parameter61Value Parameter value * @param string $parameter62Name Parameter name * @param string $parameter62Value Parameter value * @param string $parameter63Name Parameter name * @param string $parameter63Value Parameter value * @param string $parameter64Name Parameter name * @param string $parameter64Value Parameter value * @param string $parameter65Name Parameter name * @param string $parameter65Value Parameter value * @param string $parameter66Name Parameter name * @param string $parameter66Value Parameter value * @param string $parameter67Name Parameter name * @param string $parameter67Value Parameter value * @param string $parameter68Name Parameter name * @param string $parameter68Value Parameter value * @param string $parameter69Name Parameter name * @param string $parameter69Value Parameter value * @param string $parameter70Name Parameter name * @param string $parameter70Value Parameter value * @param string $parameter71Name Parameter name * @param string $parameter71Value Parameter value * @param string $parameter72Name Parameter name * @param string $parameter72Value Parameter value * @param string $parameter73Name Parameter name * @param string $parameter73Value Parameter value * @param string $parameter74Name Parameter name * @param string $parameter74Value Parameter value * @param string $parameter75Name Parameter name * @param string $parameter75Value Parameter value * @param string $parameter76Name Parameter name * @param string $parameter76Value Parameter value * @param string $parameter77Name Parameter name * @param string $parameter77Value Parameter value * @param string $parameter78Name Parameter name * @param string $parameter78Value Parameter value * @param string $parameter79Name Parameter name * @param string $parameter79Value Parameter value * @param string $parameter80Name Parameter name * @param string $parameter80Value Parameter value * @param string $parameter81Name Parameter name * @param string $parameter81Value Parameter value * @param string $parameter82Name Parameter name * @param string $parameter82Value Parameter value * @param string $parameter83Name Parameter name * @param string $parameter83Value Parameter value * @param string $parameter84Name Parameter name * @param string $parameter84Value Parameter value * @param string $parameter85Name Parameter name * @param string $parameter85Value Parameter value * @param string $parameter86Name Parameter name * @param string $parameter86Value Parameter value * @param string $parameter87Name Parameter name * @param string $parameter87Value Parameter value * @param string $parameter88Name Parameter name * @param string $parameter88Value Parameter value * @param string $parameter89Name Parameter name * @param string $parameter89Value Parameter value * @param string $parameter90Name Parameter name * @param string $parameter90Value Parameter value * @param string $parameter91Name Parameter name * @param string $parameter91Value Parameter value * @param string $parameter92Name Parameter name * @param string $parameter92Value Parameter value * @param string $parameter93Name Parameter name * @param string $parameter93Value Parameter value * @param string $parameter94Name Parameter name * @param string $parameter94Value Parameter value * @param string $parameter95Name Parameter name * @param string $parameter95Value Parameter value * @param string $parameter96Name Parameter name * @param string $parameter96Value Parameter value * @param string $parameter97Name Parameter name * @param string $parameter97Value Parameter value * @param string $parameter98Name Parameter name * @param string $parameter98Value Parameter value * @param string $parameter99Name Parameter name * @param string $parameter99Value Parameter value */ public function __construct(string $name = Values::NONE, string $track = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, string $parameter1Name = Values::NONE, string $parameter1Value = Values::NONE, string $parameter2Name = Values::NONE, string $parameter2Value = Values::NONE, string $parameter3Name = Values::NONE, string $parameter3Value = Values::NONE, string $parameter4Name = Values::NONE, string $parameter4Value = Values::NONE, string $parameter5Name = Values::NONE, string $parameter5Value = Values::NONE, string $parameter6Name = Values::NONE, string $parameter6Value = Values::NONE, string $parameter7Name = Values::NONE, string $parameter7Value = Values::NONE, string $parameter8Name = Values::NONE, string $parameter8Value = Values::NONE, string $parameter9Name = Values::NONE, string $parameter9Value = Values::NONE, string $parameter10Name = Values::NONE, string $parameter10Value = Values::NONE, string $parameter11Name = Values::NONE, string $parameter11Value = Values::NONE, string $parameter12Name = Values::NONE, string $parameter12Value = Values::NONE, string $parameter13Name = Values::NONE, string $parameter13Value = Values::NONE, string $parameter14Name = Values::NONE, string $parameter14Value = Values::NONE, string $parameter15Name = Values::NONE, string $parameter15Value = Values::NONE, string $parameter16Name = Values::NONE, string $parameter16Value = Values::NONE, string $parameter17Name = Values::NONE, string $parameter17Value = Values::NONE, string $parameter18Name = Values::NONE, string $parameter18Value = Values::NONE, string $parameter19Name = Values::NONE, string $parameter19Value = Values::NONE, string $parameter20Name = Values::NONE, string $parameter20Value = Values::NONE, string $parameter21Name = Values::NONE, string $parameter21Value = Values::NONE, string $parameter22Name = Values::NONE, string $parameter22Value = Values::NONE, string $parameter23Name = Values::NONE, string $parameter23Value = Values::NONE, string $parameter24Name = Values::NONE, string $parameter24Value = Values::NONE, string $parameter25Name = Values::NONE, string $parameter25Value = Values::NONE, string $parameter26Name = Values::NONE, string $parameter26Value = Values::NONE, string $parameter27Name = Values::NONE, string $parameter27Value = Values::NONE, string $parameter28Name = Values::NONE, string $parameter28Value = Values::NONE, string $parameter29Name = Values::NONE, string $parameter29Value = Values::NONE, string $parameter30Name = Values::NONE, string $parameter30Value = Values::NONE, string $parameter31Name = Values::NONE, string $parameter31Value = Values::NONE, string $parameter32Name = Values::NONE, string $parameter32Value = Values::NONE, string $parameter33Name = Values::NONE, string $parameter33Value = Values::NONE, string $parameter34Name = Values::NONE, string $parameter34Value = Values::NONE, string $parameter35Name = Values::NONE, string $parameter35Value = Values::NONE, string $parameter36Name = Values::NONE, string $parameter36Value = Values::NONE, string $parameter37Name = Values::NONE, string $parameter37Value = Values::NONE, string $parameter38Name = Values::NONE, string $parameter38Value = Values::NONE, string $parameter39Name = Values::NONE, string $parameter39Value = Values::NONE, string $parameter40Name = Values::NONE, string $parameter40Value = Values::NONE, string $parameter41Name = Values::NONE, string $parameter41Value = Values::NONE, string $parameter42Name = Values::NONE, string $parameter42Value = Values::NONE, string $parameter43Name = Values::NONE, string $parameter43Value = Values::NONE, string $parameter44Name = Values::NONE, string $parameter44Value = Values::NONE, string $parameter45Name = Values::NONE, string $parameter45Value = Values::NONE, string $parameter46Name = Values::NONE, string $parameter46Value = Values::NONE, string $parameter47Name = Values::NONE, string $parameter47Value = Values::NONE, string $parameter48Name = Values::NONE, string $parameter48Value = Values::NONE, string $parameter49Name = Values::NONE, string $parameter49Value = Values::NONE, string $parameter50Name = Values::NONE, string $parameter50Value = Values::NONE, string $parameter51Name = Values::NONE, string $parameter51Value = Values::NONE, string $parameter52Name = Values::NONE, string $parameter52Value = Values::NONE, string $parameter53Name = Values::NONE, string $parameter53Value = Values::NONE, string $parameter54Name = Values::NONE, string $parameter54Value = Values::NONE, string $parameter55Name = Values::NONE, string $parameter55Value = Values::NONE, string $parameter56Name = Values::NONE, string $parameter56Value = Values::NONE, string $parameter57Name = Values::NONE, string $parameter57Value = Values::NONE, string $parameter58Name = Values::NONE, string $parameter58Value = Values::NONE, string $parameter59Name = Values::NONE, string $parameter59Value = Values::NONE, string $parameter60Name = Values::NONE, string $parameter60Value = Values::NONE, string $parameter61Name = Values::NONE, string $parameter61Value = Values::NONE, string $parameter62Name = Values::NONE, string $parameter62Value = Values::NONE, string $parameter63Name = Values::NONE, string $parameter63Value = Values::NONE, string $parameter64Name = Values::NONE, string $parameter64Value = Values::NONE, string $parameter65Name = Values::NONE, string $parameter65Value = Values::NONE, string $parameter66Name = Values::NONE, string $parameter66Value = Values::NONE, string $parameter67Name = Values::NONE, string $parameter67Value = Values::NONE, string $parameter68Name = Values::NONE, string $parameter68Value = Values::NONE, string $parameter69Name = Values::NONE, string $parameter69Value = Values::NONE, string $parameter70Name = Values::NONE, string $parameter70Value = Values::NONE, string $parameter71Name = Values::NONE, string $parameter71Value = Values::NONE, string $parameter72Name = Values::NONE, string $parameter72Value = Values::NONE, string $parameter73Name = Values::NONE, string $parameter73Value = Values::NONE, string $parameter74Name = Values::NONE, string $parameter74Value = Values::NONE, string $parameter75Name = Values::NONE, string $parameter75Value = Values::NONE, string $parameter76Name = Values::NONE, string $parameter76Value = Values::NONE, string $parameter77Name = Values::NONE, string $parameter77Value = Values::NONE, string $parameter78Name = Values::NONE, string $parameter78Value = Values::NONE, string $parameter79Name = Values::NONE, string $parameter79Value = Values::NONE, string $parameter80Name = Values::NONE, string $parameter80Value = Values::NONE, string $parameter81Name = Values::NONE, string $parameter81Value = Values::NONE, string $parameter82Name = Values::NONE, string $parameter82Value = Values::NONE, string $parameter83Name = Values::NONE, string $parameter83Value = Values::NONE, string $parameter84Name = Values::NONE, string $parameter84Value = Values::NONE, string $parameter85Name = Values::NONE, string $parameter85Value = Values::NONE, string $parameter86Name = Values::NONE, string $parameter86Value = Values::NONE, string $parameter87Name = Values::NONE, string $parameter87Value = Values::NONE, string $parameter88Name = Values::NONE, string $parameter88Value = Values::NONE, string $parameter89Name = Values::NONE, string $parameter89Value = Values::NONE, string $parameter90Name = Values::NONE, string $parameter90Value = Values::NONE, string $parameter91Name = Values::NONE, string $parameter91Value = Values::NONE, string $parameter92Name = Values::NONE, string $parameter92Value = Values::NONE, string $parameter93Name = Values::NONE, string $parameter93Value = Values::NONE, string $parameter94Name = Values::NONE, string $parameter94Value = Values::NONE, string $parameter95Name = Values::NONE, string $parameter95Value = Values::NONE, string $parameter96Name = Values::NONE, string $parameter96Value = Values::NONE, string $parameter97Name = Values::NONE, string $parameter97Value = Values::NONE, string $parameter98Name = Values::NONE, string $parameter98Value = Values::NONE, string $parameter99Name = Values::NONE, string $parameter99Value = Values::NONE) { $this->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 may be used to stop the Stream. * * @param string $name The name of this resource * @return $this Fluent Builder */ public function setName(string $name): self { $this->options['name'] = $name; return $this; } /** * One of `inbound_track`, `outbound_track`, `both_tracks`. * * @param string $track One of `inbound_track`, `outbound_track`, `both_tracks`. * @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. * @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 . ']'; } } Api/V2010/Account/Call/NotificationContext.php 0000644 00000003761 15107452335 0014754 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class NotificationContext extends InstanceContext { /** * Initialize the NotificationContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $callSid The Call SID of the resource to fetch * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $accountSid, $callSid, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Api/V2010/Account/Call/SiprecContext.php 0000644 00000004070 15107452335 0013545 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class SiprecContext extends InstanceContext { /** * Initialize the SiprecContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created this resource * @param string $callSid The SID of the Call the resource is associated with * @param string $sid The SID of the Siprec resource, or the `name` */ public function __construct(Version $version, $accountSid, $callSid, $sid) { parent::__construct($version); // Path Solution $this->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 The status. Must have the value `stopped` * @return SiprecInstance Updated SiprecInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status): SiprecInstance { $data = Values::of(['Status' => $status, ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } Api/V2010/Account/Call/FeedbackOptions.php 0000644 00000007073 15107452335 0014021 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Options; use Twilio\Values; abstract class FeedbackOptions { /** * @param string[] $issue Issues experienced during the call * @return CreateFeedbackOptions Options builder */ public static function create(array $issue = Values::ARRAY_NONE): CreateFeedbackOptions { return new CreateFeedbackOptions($issue); } /** * @param int $qualityScore The call quality expressed as an integer from 1 to 5 * @param string[] $issue Issues experienced during the call * @return UpdateFeedbackOptions Options builder */ public static function update(int $qualityScore = Values::NONE, array $issue = Values::ARRAY_NONE): UpdateFeedbackOptions { return new UpdateFeedbackOptions($qualityScore, $issue); } } class CreateFeedbackOptions extends Options { /** * @param string[] $issue Issues experienced during the call */ public function __construct(array $issue = Values::ARRAY_NONE) { $this->options['issue'] = $issue; } /** * A list of one or more issues experienced during the call. Issues can be: `imperfect-audio`, `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, `audio-latency`, `unsolicited-call`, or `one-way-audio`. * * @param string[] $issue Issues experienced during the call * @return $this Fluent Builder */ public function setIssue(array $issue): self { $this->options['issue'] = $issue; return $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 . ']'; } } class UpdateFeedbackOptions extends Options { /** * @param int $qualityScore The call quality expressed as an integer from 1 to 5 * @param string[] $issue Issues experienced during the call */ public function __construct(int $qualityScore = Values::NONE, array $issue = Values::ARRAY_NONE) { $this->options['qualityScore'] = $qualityScore; $this->options['issue'] = $issue; } /** * The call quality expressed as an integer from `1` to `5` where `1` represents very poor call quality and `5` represents a perfect call. * * @param int $qualityScore The call quality expressed as an integer from 1 to 5 * @return $this Fluent Builder */ public function setQualityScore(int $qualityScore): self { $this->options['qualityScore'] = $qualityScore; return $this; } /** * One or more issues experienced during the call. The issues can be: `imperfect-audio`, `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, `audio-latency`, `unsolicited-call`, or `one-way-audio`. * * @param string[] $issue Issues experienced during the call * @return $this Fluent Builder */ public function setIssue(array $issue): self { $this->options['issue'] = $issue; return $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.UpdateFeedbackOptions ' . $options . ']'; } } Api/V2010/Account/Call/SiprecOptions.php 0000644 00000344567 15107452335 0013576 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Options; use Twilio\Values; abstract class SiprecOptions { /** * @param string $name The name of this resource * @param string $connectorName Unique name used when configuring the connector * via Marketplace Add-on. * @param string $track One of `inbound_track`, `outbound_track`, `both_tracks`. * @param string $statusCallback Absolute URL of the status callback. * @param string $statusCallbackMethod The http method for the status_callback. * @param string $parameter1Name Parameter name * @param string $parameter1Value Parameter value * @param string $parameter2Name Parameter name * @param string $parameter2Value Parameter value * @param string $parameter3Name Parameter name * @param string $parameter3Value Parameter value * @param string $parameter4Name Parameter name * @param string $parameter4Value Parameter value * @param string $parameter5Name Parameter name * @param string $parameter5Value Parameter value * @param string $parameter6Name Parameter name * @param string $parameter6Value Parameter value * @param string $parameter7Name Parameter name * @param string $parameter7Value Parameter value * @param string $parameter8Name Parameter name * @param string $parameter8Value Parameter value * @param string $parameter9Name Parameter name * @param string $parameter9Value Parameter value * @param string $parameter10Name Parameter name * @param string $parameter10Value Parameter value * @param string $parameter11Name Parameter name * @param string $parameter11Value Parameter value * @param string $parameter12Name Parameter name * @param string $parameter12Value Parameter value * @param string $parameter13Name Parameter name * @param string $parameter13Value Parameter value * @param string $parameter14Name Parameter name * @param string $parameter14Value Parameter value * @param string $parameter15Name Parameter name * @param string $parameter15Value Parameter value * @param string $parameter16Name Parameter name * @param string $parameter16Value Parameter value * @param string $parameter17Name Parameter name * @param string $parameter17Value Parameter value * @param string $parameter18Name Parameter name * @param string $parameter18Value Parameter value * @param string $parameter19Name Parameter name * @param string $parameter19Value Parameter value * @param string $parameter20Name Parameter name * @param string $parameter20Value Parameter value * @param string $parameter21Name Parameter name * @param string $parameter21Value Parameter value * @param string $parameter22Name Parameter name * @param string $parameter22Value Parameter value * @param string $parameter23Name Parameter name * @param string $parameter23Value Parameter value * @param string $parameter24Name Parameter name * @param string $parameter24Value Parameter value * @param string $parameter25Name Parameter name * @param string $parameter25Value Parameter value * @param string $parameter26Name Parameter name * @param string $parameter26Value Parameter value * @param string $parameter27Name Parameter name * @param string $parameter27Value Parameter value * @param string $parameter28Name Parameter name * @param string $parameter28Value Parameter value * @param string $parameter29Name Parameter name * @param string $parameter29Value Parameter value * @param string $parameter30Name Parameter name * @param string $parameter30Value Parameter value * @param string $parameter31Name Parameter name * @param string $parameter31Value Parameter value * @param string $parameter32Name Parameter name * @param string $parameter32Value Parameter value * @param string $parameter33Name Parameter name * @param string $parameter33Value Parameter value * @param string $parameter34Name Parameter name * @param string $parameter34Value Parameter value * @param string $parameter35Name Parameter name * @param string $parameter35Value Parameter value * @param string $parameter36Name Parameter name * @param string $parameter36Value Parameter value * @param string $parameter37Name Parameter name * @param string $parameter37Value Parameter value * @param string $parameter38Name Parameter name * @param string $parameter38Value Parameter value * @param string $parameter39Name Parameter name * @param string $parameter39Value Parameter value * @param string $parameter40Name Parameter name * @param string $parameter40Value Parameter value * @param string $parameter41Name Parameter name * @param string $parameter41Value Parameter value * @param string $parameter42Name Parameter name * @param string $parameter42Value Parameter value * @param string $parameter43Name Parameter name * @param string $parameter43Value Parameter value * @param string $parameter44Name Parameter name * @param string $parameter44Value Parameter value * @param string $parameter45Name Parameter name * @param string $parameter45Value Parameter value * @param string $parameter46Name Parameter name * @param string $parameter46Value Parameter value * @param string $parameter47Name Parameter name * @param string $parameter47Value Parameter value * @param string $parameter48Name Parameter name * @param string $parameter48Value Parameter value * @param string $parameter49Name Parameter name * @param string $parameter49Value Parameter value * @param string $parameter50Name Parameter name * @param string $parameter50Value Parameter value * @param string $parameter51Name Parameter name * @param string $parameter51Value Parameter value * @param string $parameter52Name Parameter name * @param string $parameter52Value Parameter value * @param string $parameter53Name Parameter name * @param string $parameter53Value Parameter value * @param string $parameter54Name Parameter name * @param string $parameter54Value Parameter value * @param string $parameter55Name Parameter name * @param string $parameter55Value Parameter value * @param string $parameter56Name Parameter name * @param string $parameter56Value Parameter value * @param string $parameter57Name Parameter name * @param string $parameter57Value Parameter value * @param string $parameter58Name Parameter name * @param string $parameter58Value Parameter value * @param string $parameter59Name Parameter name * @param string $parameter59Value Parameter value * @param string $parameter60Name Parameter name * @param string $parameter60Value Parameter value * @param string $parameter61Name Parameter name * @param string $parameter61Value Parameter value * @param string $parameter62Name Parameter name * @param string $parameter62Value Parameter value * @param string $parameter63Name Parameter name * @param string $parameter63Value Parameter value * @param string $parameter64Name Parameter name * @param string $parameter64Value Parameter value * @param string $parameter65Name Parameter name * @param string $parameter65Value Parameter value * @param string $parameter66Name Parameter name * @param string $parameter66Value Parameter value * @param string $parameter67Name Parameter name * @param string $parameter67Value Parameter value * @param string $parameter68Name Parameter name * @param string $parameter68Value Parameter value * @param string $parameter69Name Parameter name * @param string $parameter69Value Parameter value * @param string $parameter70Name Parameter name * @param string $parameter70Value Parameter value * @param string $parameter71Name Parameter name * @param string $parameter71Value Parameter value * @param string $parameter72Name Parameter name * @param string $parameter72Value Parameter value * @param string $parameter73Name Parameter name * @param string $parameter73Value Parameter value * @param string $parameter74Name Parameter name * @param string $parameter74Value Parameter value * @param string $parameter75Name Parameter name * @param string $parameter75Value Parameter value * @param string $parameter76Name Parameter name * @param string $parameter76Value Parameter value * @param string $parameter77Name Parameter name * @param string $parameter77Value Parameter value * @param string $parameter78Name Parameter name * @param string $parameter78Value Parameter value * @param string $parameter79Name Parameter name * @param string $parameter79Value Parameter value * @param string $parameter80Name Parameter name * @param string $parameter80Value Parameter value * @param string $parameter81Name Parameter name * @param string $parameter81Value Parameter value * @param string $parameter82Name Parameter name * @param string $parameter82Value Parameter value * @param string $parameter83Name Parameter name * @param string $parameter83Value Parameter value * @param string $parameter84Name Parameter name * @param string $parameter84Value Parameter value * @param string $parameter85Name Parameter name * @param string $parameter85Value Parameter value * @param string $parameter86Name Parameter name * @param string $parameter86Value Parameter value * @param string $parameter87Name Parameter name * @param string $parameter87Value Parameter value * @param string $parameter88Name Parameter name * @param string $parameter88Value Parameter value * @param string $parameter89Name Parameter name * @param string $parameter89Value Parameter value * @param string $parameter90Name Parameter name * @param string $parameter90Value Parameter value * @param string $parameter91Name Parameter name * @param string $parameter91Value Parameter value * @param string $parameter92Name Parameter name * @param string $parameter92Value Parameter value * @param string $parameter93Name Parameter name * @param string $parameter93Value Parameter value * @param string $parameter94Name Parameter name * @param string $parameter94Value Parameter value * @param string $parameter95Name Parameter name * @param string $parameter95Value Parameter value * @param string $parameter96Name Parameter name * @param string $parameter96Value Parameter value * @param string $parameter97Name Parameter name * @param string $parameter97Value Parameter value * @param string $parameter98Name Parameter name * @param string $parameter98Value Parameter value * @param string $parameter99Name Parameter name * @param string $parameter99Value Parameter value * @return CreateSiprecOptions Options builder */ public static function create(string $name = Values::NONE, string $connectorName = Values::NONE, string $track = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, string $parameter1Name = Values::NONE, string $parameter1Value = Values::NONE, string $parameter2Name = Values::NONE, string $parameter2Value = Values::NONE, string $parameter3Name = Values::NONE, string $parameter3Value = Values::NONE, string $parameter4Name = Values::NONE, string $parameter4Value = Values::NONE, string $parameter5Name = Values::NONE, string $parameter5Value = Values::NONE, string $parameter6Name = Values::NONE, string $parameter6Value = Values::NONE, string $parameter7Name = Values::NONE, string $parameter7Value = Values::NONE, string $parameter8Name = Values::NONE, string $parameter8Value = Values::NONE, string $parameter9Name = Values::NONE, string $parameter9Value = Values::NONE, string $parameter10Name = Values::NONE, string $parameter10Value = Values::NONE, string $parameter11Name = Values::NONE, string $parameter11Value = Values::NONE, string $parameter12Name = Values::NONE, string $parameter12Value = Values::NONE, string $parameter13Name = Values::NONE, string $parameter13Value = Values::NONE, string $parameter14Name = Values::NONE, string $parameter14Value = Values::NONE, string $parameter15Name = Values::NONE, string $parameter15Value = Values::NONE, string $parameter16Name = Values::NONE, string $parameter16Value = Values::NONE, string $parameter17Name = Values::NONE, string $parameter17Value = Values::NONE, string $parameter18Name = Values::NONE, string $parameter18Value = Values::NONE, string $parameter19Name = Values::NONE, string $parameter19Value = Values::NONE, string $parameter20Name = Values::NONE, string $parameter20Value = Values::NONE, string $parameter21Name = Values::NONE, string $parameter21Value = Values::NONE, string $parameter22Name = Values::NONE, string $parameter22Value = Values::NONE, string $parameter23Name = Values::NONE, string $parameter23Value = Values::NONE, string $parameter24Name = Values::NONE, string $parameter24Value = Values::NONE, string $parameter25Name = Values::NONE, string $parameter25Value = Values::NONE, string $parameter26Name = Values::NONE, string $parameter26Value = Values::NONE, string $parameter27Name = Values::NONE, string $parameter27Value = Values::NONE, string $parameter28Name = Values::NONE, string $parameter28Value = Values::NONE, string $parameter29Name = Values::NONE, string $parameter29Value = Values::NONE, string $parameter30Name = Values::NONE, string $parameter30Value = Values::NONE, string $parameter31Name = Values::NONE, string $parameter31Value = Values::NONE, string $parameter32Name = Values::NONE, string $parameter32Value = Values::NONE, string $parameter33Name = Values::NONE, string $parameter33Value = Values::NONE, string $parameter34Name = Values::NONE, string $parameter34Value = Values::NONE, string $parameter35Name = Values::NONE, string $parameter35Value = Values::NONE, string $parameter36Name = Values::NONE, string $parameter36Value = Values::NONE, string $parameter37Name = Values::NONE, string $parameter37Value = Values::NONE, string $parameter38Name = Values::NONE, string $parameter38Value = Values::NONE, string $parameter39Name = Values::NONE, string $parameter39Value = Values::NONE, string $parameter40Name = Values::NONE, string $parameter40Value = Values::NONE, string $parameter41Name = Values::NONE, string $parameter41Value = Values::NONE, string $parameter42Name = Values::NONE, string $parameter42Value = Values::NONE, string $parameter43Name = Values::NONE, string $parameter43Value = Values::NONE, string $parameter44Name = Values::NONE, string $parameter44Value = Values::NONE, string $parameter45Name = Values::NONE, string $parameter45Value = Values::NONE, string $parameter46Name = Values::NONE, string $parameter46Value = Values::NONE, string $parameter47Name = Values::NONE, string $parameter47Value = Values::NONE, string $parameter48Name = Values::NONE, string $parameter48Value = Values::NONE, string $parameter49Name = Values::NONE, string $parameter49Value = Values::NONE, string $parameter50Name = Values::NONE, string $parameter50Value = Values::NONE, string $parameter51Name = Values::NONE, string $parameter51Value = Values::NONE, string $parameter52Name = Values::NONE, string $parameter52Value = Values::NONE, string $parameter53Name = Values::NONE, string $parameter53Value = Values::NONE, string $parameter54Name = Values::NONE, string $parameter54Value = Values::NONE, string $parameter55Name = Values::NONE, string $parameter55Value = Values::NONE, string $parameter56Name = Values::NONE, string $parameter56Value = Values::NONE, string $parameter57Name = Values::NONE, string $parameter57Value = Values::NONE, string $parameter58Name = Values::NONE, string $parameter58Value = Values::NONE, string $parameter59Name = Values::NONE, string $parameter59Value = Values::NONE, string $parameter60Name = Values::NONE, string $parameter60Value = Values::NONE, string $parameter61Name = Values::NONE, string $parameter61Value = Values::NONE, string $parameter62Name = Values::NONE, string $parameter62Value = Values::NONE, string $parameter63Name = Values::NONE, string $parameter63Value = Values::NONE, string $parameter64Name = Values::NONE, string $parameter64Value = Values::NONE, string $parameter65Name = Values::NONE, string $parameter65Value = Values::NONE, string $parameter66Name = Values::NONE, string $parameter66Value = Values::NONE, string $parameter67Name = Values::NONE, string $parameter67Value = Values::NONE, string $parameter68Name = Values::NONE, string $parameter68Value = Values::NONE, string $parameter69Name = Values::NONE, string $parameter69Value = Values::NONE, string $parameter70Name = Values::NONE, string $parameter70Value = Values::NONE, string $parameter71Name = Values::NONE, string $parameter71Value = Values::NONE, string $parameter72Name = Values::NONE, string $parameter72Value = Values::NONE, string $parameter73Name = Values::NONE, string $parameter73Value = Values::NONE, string $parameter74Name = Values::NONE, string $parameter74Value = Values::NONE, string $parameter75Name = Values::NONE, string $parameter75Value = Values::NONE, string $parameter76Name = Values::NONE, string $parameter76Value = Values::NONE, string $parameter77Name = Values::NONE, string $parameter77Value = Values::NONE, string $parameter78Name = Values::NONE, string $parameter78Value = Values::NONE, string $parameter79Name = Values::NONE, string $parameter79Value = Values::NONE, string $parameter80Name = Values::NONE, string $parameter80Value = Values::NONE, string $parameter81Name = Values::NONE, string $parameter81Value = Values::NONE, string $parameter82Name = Values::NONE, string $parameter82Value = Values::NONE, string $parameter83Name = Values::NONE, string $parameter83Value = Values::NONE, string $parameter84Name = Values::NONE, string $parameter84Value = Values::NONE, string $parameter85Name = Values::NONE, string $parameter85Value = Values::NONE, string $parameter86Name = Values::NONE, string $parameter86Value = Values::NONE, string $parameter87Name = Values::NONE, string $parameter87Value = Values::NONE, string $parameter88Name = Values::NONE, string $parameter88Value = Values::NONE, string $parameter89Name = Values::NONE, string $parameter89Value = Values::NONE, string $parameter90Name = Values::NONE, string $parameter90Value = Values::NONE, string $parameter91Name = Values::NONE, string $parameter91Value = Values::NONE, string $parameter92Name = Values::NONE, string $parameter92Value = Values::NONE, string $parameter93Name = Values::NONE, string $parameter93Value = Values::NONE, string $parameter94Name = Values::NONE, string $parameter94Value = Values::NONE, string $parameter95Name = Values::NONE, string $parameter95Value = Values::NONE, string $parameter96Name = Values::NONE, string $parameter96Value = Values::NONE, string $parameter97Name = Values::NONE, string $parameter97Value = Values::NONE, string $parameter98Name = Values::NONE, string $parameter98Value = Values::NONE, string $parameter99Name = Values::NONE, string $parameter99Value = Values::NONE): CreateSiprecOptions { return new CreateSiprecOptions($name, $connectorName, $track, $statusCallback, $statusCallbackMethod, $parameter1Name, $parameter1Value, $parameter2Name, $parameter2Value, $parameter3Name, $parameter3Value, $parameter4Name, $parameter4Value, $parameter5Name, $parameter5Value, $parameter6Name, $parameter6Value, $parameter7Name, $parameter7Value, $parameter8Name, $parameter8Value, $parameter9Name, $parameter9Value, $parameter10Name, $parameter10Value, $parameter11Name, $parameter11Value, $parameter12Name, $parameter12Value, $parameter13Name, $parameter13Value, $parameter14Name, $parameter14Value, $parameter15Name, $parameter15Value, $parameter16Name, $parameter16Value, $parameter17Name, $parameter17Value, $parameter18Name, $parameter18Value, $parameter19Name, $parameter19Value, $parameter20Name, $parameter20Value, $parameter21Name, $parameter21Value, $parameter22Name, $parameter22Value, $parameter23Name, $parameter23Value, $parameter24Name, $parameter24Value, $parameter25Name, $parameter25Value, $parameter26Name, $parameter26Value, $parameter27Name, $parameter27Value, $parameter28Name, $parameter28Value, $parameter29Name, $parameter29Value, $parameter30Name, $parameter30Value, $parameter31Name, $parameter31Value, $parameter32Name, $parameter32Value, $parameter33Name, $parameter33Value, $parameter34Name, $parameter34Value, $parameter35Name, $parameter35Value, $parameter36Name, $parameter36Value, $parameter37Name, $parameter37Value, $parameter38Name, $parameter38Value, $parameter39Name, $parameter39Value, $parameter40Name, $parameter40Value, $parameter41Name, $parameter41Value, $parameter42Name, $parameter42Value, $parameter43Name, $parameter43Value, $parameter44Name, $parameter44Value, $parameter45Name, $parameter45Value, $parameter46Name, $parameter46Value, $parameter47Name, $parameter47Value, $parameter48Name, $parameter48Value, $parameter49Name, $parameter49Value, $parameter50Name, $parameter50Value, $parameter51Name, $parameter51Value, $parameter52Name, $parameter52Value, $parameter53Name, $parameter53Value, $parameter54Name, $parameter54Value, $parameter55Name, $parameter55Value, $parameter56Name, $parameter56Value, $parameter57Name, $parameter57Value, $parameter58Name, $parameter58Value, $parameter59Name, $parameter59Value, $parameter60Name, $parameter60Value, $parameter61Name, $parameter61Value, $parameter62Name, $parameter62Value, $parameter63Name, $parameter63Value, $parameter64Name, $parameter64Value, $parameter65Name, $parameter65Value, $parameter66Name, $parameter66Value, $parameter67Name, $parameter67Value, $parameter68Name, $parameter68Value, $parameter69Name, $parameter69Value, $parameter70Name, $parameter70Value, $parameter71Name, $parameter71Value, $parameter72Name, $parameter72Value, $parameter73Name, $parameter73Value, $parameter74Name, $parameter74Value, $parameter75Name, $parameter75Value, $parameter76Name, $parameter76Value, $parameter77Name, $parameter77Value, $parameter78Name, $parameter78Value, $parameter79Name, $parameter79Value, $parameter80Name, $parameter80Value, $parameter81Name, $parameter81Value, $parameter82Name, $parameter82Value, $parameter83Name, $parameter83Value, $parameter84Name, $parameter84Value, $parameter85Name, $parameter85Value, $parameter86Name, $parameter86Value, $parameter87Name, $parameter87Value, $parameter88Name, $parameter88Value, $parameter89Name, $parameter89Value, $parameter90Name, $parameter90Value, $parameter91Name, $parameter91Value, $parameter92Name, $parameter92Value, $parameter93Name, $parameter93Value, $parameter94Name, $parameter94Value, $parameter95Name, $parameter95Value, $parameter96Name, $parameter96Value, $parameter97Name, $parameter97Value, $parameter98Name, $parameter98Value, $parameter99Name, $parameter99Value); } } class CreateSiprecOptions extends Options { /** * @param string $name The name of this resource * @param string $connectorName Unique name used when configuring the connector * via Marketplace Add-on. * @param string $track One of `inbound_track`, `outbound_track`, `both_tracks`. * @param string $statusCallback Absolute URL of the status callback. * @param string $statusCallbackMethod The http method for the status_callback. * @param string $parameter1Name Parameter name * @param string $parameter1Value Parameter value * @param string $parameter2Name Parameter name * @param string $parameter2Value Parameter value * @param string $parameter3Name Parameter name * @param string $parameter3Value Parameter value * @param string $parameter4Name Parameter name * @param string $parameter4Value Parameter value * @param string $parameter5Name Parameter name * @param string $parameter5Value Parameter value * @param string $parameter6Name Parameter name * @param string $parameter6Value Parameter value * @param string $parameter7Name Parameter name * @param string $parameter7Value Parameter value * @param string $parameter8Name Parameter name * @param string $parameter8Value Parameter value * @param string $parameter9Name Parameter name * @param string $parameter9Value Parameter value * @param string $parameter10Name Parameter name * @param string $parameter10Value Parameter value * @param string $parameter11Name Parameter name * @param string $parameter11Value Parameter value * @param string $parameter12Name Parameter name * @param string $parameter12Value Parameter value * @param string $parameter13Name Parameter name * @param string $parameter13Value Parameter value * @param string $parameter14Name Parameter name * @param string $parameter14Value Parameter value * @param string $parameter15Name Parameter name * @param string $parameter15Value Parameter value * @param string $parameter16Name Parameter name * @param string $parameter16Value Parameter value * @param string $parameter17Name Parameter name * @param string $parameter17Value Parameter value * @param string $parameter18Name Parameter name * @param string $parameter18Value Parameter value * @param string $parameter19Name Parameter name * @param string $parameter19Value Parameter value * @param string $parameter20Name Parameter name * @param string $parameter20Value Parameter value * @param string $parameter21Name Parameter name * @param string $parameter21Value Parameter value * @param string $parameter22Name Parameter name * @param string $parameter22Value Parameter value * @param string $parameter23Name Parameter name * @param string $parameter23Value Parameter value * @param string $parameter24Name Parameter name * @param string $parameter24Value Parameter value * @param string $parameter25Name Parameter name * @param string $parameter25Value Parameter value * @param string $parameter26Name Parameter name * @param string $parameter26Value Parameter value * @param string $parameter27Name Parameter name * @param string $parameter27Value Parameter value * @param string $parameter28Name Parameter name * @param string $parameter28Value Parameter value * @param string $parameter29Name Parameter name * @param string $parameter29Value Parameter value * @param string $parameter30Name Parameter name * @param string $parameter30Value Parameter value * @param string $parameter31Name Parameter name * @param string $parameter31Value Parameter value * @param string $parameter32Name Parameter name * @param string $parameter32Value Parameter value * @param string $parameter33Name Parameter name * @param string $parameter33Value Parameter value * @param string $parameter34Name Parameter name * @param string $parameter34Value Parameter value * @param string $parameter35Name Parameter name * @param string $parameter35Value Parameter value * @param string $parameter36Name Parameter name * @param string $parameter36Value Parameter value * @param string $parameter37Name Parameter name * @param string $parameter37Value Parameter value * @param string $parameter38Name Parameter name * @param string $parameter38Value Parameter value * @param string $parameter39Name Parameter name * @param string $parameter39Value Parameter value * @param string $parameter40Name Parameter name * @param string $parameter40Value Parameter value * @param string $parameter41Name Parameter name * @param string $parameter41Value Parameter value * @param string $parameter42Name Parameter name * @param string $parameter42Value Parameter value * @param string $parameter43Name Parameter name * @param string $parameter43Value Parameter value * @param string $parameter44Name Parameter name * @param string $parameter44Value Parameter value * @param string $parameter45Name Parameter name * @param string $parameter45Value Parameter value * @param string $parameter46Name Parameter name * @param string $parameter46Value Parameter value * @param string $parameter47Name Parameter name * @param string $parameter47Value Parameter value * @param string $parameter48Name Parameter name * @param string $parameter48Value Parameter value * @param string $parameter49Name Parameter name * @param string $parameter49Value Parameter value * @param string $parameter50Name Parameter name * @param string $parameter50Value Parameter value * @param string $parameter51Name Parameter name * @param string $parameter51Value Parameter value * @param string $parameter52Name Parameter name * @param string $parameter52Value Parameter value * @param string $parameter53Name Parameter name * @param string $parameter53Value Parameter value * @param string $parameter54Name Parameter name * @param string $parameter54Value Parameter value * @param string $parameter55Name Parameter name * @param string $parameter55Value Parameter value * @param string $parameter56Name Parameter name * @param string $parameter56Value Parameter value * @param string $parameter57Name Parameter name * @param string $parameter57Value Parameter value * @param string $parameter58Name Parameter name * @param string $parameter58Value Parameter value * @param string $parameter59Name Parameter name * @param string $parameter59Value Parameter value * @param string $parameter60Name Parameter name * @param string $parameter60Value Parameter value * @param string $parameter61Name Parameter name * @param string $parameter61Value Parameter value * @param string $parameter62Name Parameter name * @param string $parameter62Value Parameter value * @param string $parameter63Name Parameter name * @param string $parameter63Value Parameter value * @param string $parameter64Name Parameter name * @param string $parameter64Value Parameter value * @param string $parameter65Name Parameter name * @param string $parameter65Value Parameter value * @param string $parameter66Name Parameter name * @param string $parameter66Value Parameter value * @param string $parameter67Name Parameter name * @param string $parameter67Value Parameter value * @param string $parameter68Name Parameter name * @param string $parameter68Value Parameter value * @param string $parameter69Name Parameter name * @param string $parameter69Value Parameter value * @param string $parameter70Name Parameter name * @param string $parameter70Value Parameter value * @param string $parameter71Name Parameter name * @param string $parameter71Value Parameter value * @param string $parameter72Name Parameter name * @param string $parameter72Value Parameter value * @param string $parameter73Name Parameter name * @param string $parameter73Value Parameter value * @param string $parameter74Name Parameter name * @param string $parameter74Value Parameter value * @param string $parameter75Name Parameter name * @param string $parameter75Value Parameter value * @param string $parameter76Name Parameter name * @param string $parameter76Value Parameter value * @param string $parameter77Name Parameter name * @param string $parameter77Value Parameter value * @param string $parameter78Name Parameter name * @param string $parameter78Value Parameter value * @param string $parameter79Name Parameter name * @param string $parameter79Value Parameter value * @param string $parameter80Name Parameter name * @param string $parameter80Value Parameter value * @param string $parameter81Name Parameter name * @param string $parameter81Value Parameter value * @param string $parameter82Name Parameter name * @param string $parameter82Value Parameter value * @param string $parameter83Name Parameter name * @param string $parameter83Value Parameter value * @param string $parameter84Name Parameter name * @param string $parameter84Value Parameter value * @param string $parameter85Name Parameter name * @param string $parameter85Value Parameter value * @param string $parameter86Name Parameter name * @param string $parameter86Value Parameter value * @param string $parameter87Name Parameter name * @param string $parameter87Value Parameter value * @param string $parameter88Name Parameter name * @param string $parameter88Value Parameter value * @param string $parameter89Name Parameter name * @param string $parameter89Value Parameter value * @param string $parameter90Name Parameter name * @param string $parameter90Value Parameter value * @param string $parameter91Name Parameter name * @param string $parameter91Value Parameter value * @param string $parameter92Name Parameter name * @param string $parameter92Value Parameter value * @param string $parameter93Name Parameter name * @param string $parameter93Value Parameter value * @param string $parameter94Name Parameter name * @param string $parameter94Value Parameter value * @param string $parameter95Name Parameter name * @param string $parameter95Value Parameter value * @param string $parameter96Name Parameter name * @param string $parameter96Value Parameter value * @param string $parameter97Name Parameter name * @param string $parameter97Value Parameter value * @param string $parameter98Name Parameter name * @param string $parameter98Value Parameter value * @param string $parameter99Name Parameter name * @param string $parameter99Value Parameter value */ public function __construct(string $name = Values::NONE, string $connectorName = Values::NONE, string $track = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, string $parameter1Name = Values::NONE, string $parameter1Value = Values::NONE, string $parameter2Name = Values::NONE, string $parameter2Value = Values::NONE, string $parameter3Name = Values::NONE, string $parameter3Value = Values::NONE, string $parameter4Name = Values::NONE, string $parameter4Value = Values::NONE, string $parameter5Name = Values::NONE, string $parameter5Value = Values::NONE, string $parameter6Name = Values::NONE, string $parameter6Value = Values::NONE, string $parameter7Name = Values::NONE, string $parameter7Value = Values::NONE, string $parameter8Name = Values::NONE, string $parameter8Value = Values::NONE, string $parameter9Name = Values::NONE, string $parameter9Value = Values::NONE, string $parameter10Name = Values::NONE, string $parameter10Value = Values::NONE, string $parameter11Name = Values::NONE, string $parameter11Value = Values::NONE, string $parameter12Name = Values::NONE, string $parameter12Value = Values::NONE, string $parameter13Name = Values::NONE, string $parameter13Value = Values::NONE, string $parameter14Name = Values::NONE, string $parameter14Value = Values::NONE, string $parameter15Name = Values::NONE, string $parameter15Value = Values::NONE, string $parameter16Name = Values::NONE, string $parameter16Value = Values::NONE, string $parameter17Name = Values::NONE, string $parameter17Value = Values::NONE, string $parameter18Name = Values::NONE, string $parameter18Value = Values::NONE, string $parameter19Name = Values::NONE, string $parameter19Value = Values::NONE, string $parameter20Name = Values::NONE, string $parameter20Value = Values::NONE, string $parameter21Name = Values::NONE, string $parameter21Value = Values::NONE, string $parameter22Name = Values::NONE, string $parameter22Value = Values::NONE, string $parameter23Name = Values::NONE, string $parameter23Value = Values::NONE, string $parameter24Name = Values::NONE, string $parameter24Value = Values::NONE, string $parameter25Name = Values::NONE, string $parameter25Value = Values::NONE, string $parameter26Name = Values::NONE, string $parameter26Value = Values::NONE, string $parameter27Name = Values::NONE, string $parameter27Value = Values::NONE, string $parameter28Name = Values::NONE, string $parameter28Value = Values::NONE, string $parameter29Name = Values::NONE, string $parameter29Value = Values::NONE, string $parameter30Name = Values::NONE, string $parameter30Value = Values::NONE, string $parameter31Name = Values::NONE, string $parameter31Value = Values::NONE, string $parameter32Name = Values::NONE, string $parameter32Value = Values::NONE, string $parameter33Name = Values::NONE, string $parameter33Value = Values::NONE, string $parameter34Name = Values::NONE, string $parameter34Value = Values::NONE, string $parameter35Name = Values::NONE, string $parameter35Value = Values::NONE, string $parameter36Name = Values::NONE, string $parameter36Value = Values::NONE, string $parameter37Name = Values::NONE, string $parameter37Value = Values::NONE, string $parameter38Name = Values::NONE, string $parameter38Value = Values::NONE, string $parameter39Name = Values::NONE, string $parameter39Value = Values::NONE, string $parameter40Name = Values::NONE, string $parameter40Value = Values::NONE, string $parameter41Name = Values::NONE, string $parameter41Value = Values::NONE, string $parameter42Name = Values::NONE, string $parameter42Value = Values::NONE, string $parameter43Name = Values::NONE, string $parameter43Value = Values::NONE, string $parameter44Name = Values::NONE, string $parameter44Value = Values::NONE, string $parameter45Name = Values::NONE, string $parameter45Value = Values::NONE, string $parameter46Name = Values::NONE, string $parameter46Value = Values::NONE, string $parameter47Name = Values::NONE, string $parameter47Value = Values::NONE, string $parameter48Name = Values::NONE, string $parameter48Value = Values::NONE, string $parameter49Name = Values::NONE, string $parameter49Value = Values::NONE, string $parameter50Name = Values::NONE, string $parameter50Value = Values::NONE, string $parameter51Name = Values::NONE, string $parameter51Value = Values::NONE, string $parameter52Name = Values::NONE, string $parameter52Value = Values::NONE, string $parameter53Name = Values::NONE, string $parameter53Value = Values::NONE, string $parameter54Name = Values::NONE, string $parameter54Value = Values::NONE, string $parameter55Name = Values::NONE, string $parameter55Value = Values::NONE, string $parameter56Name = Values::NONE, string $parameter56Value = Values::NONE, string $parameter57Name = Values::NONE, string $parameter57Value = Values::NONE, string $parameter58Name = Values::NONE, string $parameter58Value = Values::NONE, string $parameter59Name = Values::NONE, string $parameter59Value = Values::NONE, string $parameter60Name = Values::NONE, string $parameter60Value = Values::NONE, string $parameter61Name = Values::NONE, string $parameter61Value = Values::NONE, string $parameter62Name = Values::NONE, string $parameter62Value = Values::NONE, string $parameter63Name = Values::NONE, string $parameter63Value = Values::NONE, string $parameter64Name = Values::NONE, string $parameter64Value = Values::NONE, string $parameter65Name = Values::NONE, string $parameter65Value = Values::NONE, string $parameter66Name = Values::NONE, string $parameter66Value = Values::NONE, string $parameter67Name = Values::NONE, string $parameter67Value = Values::NONE, string $parameter68Name = Values::NONE, string $parameter68Value = Values::NONE, string $parameter69Name = Values::NONE, string $parameter69Value = Values::NONE, string $parameter70Name = Values::NONE, string $parameter70Value = Values::NONE, string $parameter71Name = Values::NONE, string $parameter71Value = Values::NONE, string $parameter72Name = Values::NONE, string $parameter72Value = Values::NONE, string $parameter73Name = Values::NONE, string $parameter73Value = Values::NONE, string $parameter74Name = Values::NONE, string $parameter74Value = Values::NONE, string $parameter75Name = Values::NONE, string $parameter75Value = Values::NONE, string $parameter76Name = Values::NONE, string $parameter76Value = Values::NONE, string $parameter77Name = Values::NONE, string $parameter77Value = Values::NONE, string $parameter78Name = Values::NONE, string $parameter78Value = Values::NONE, string $parameter79Name = Values::NONE, string $parameter79Value = Values::NONE, string $parameter80Name = Values::NONE, string $parameter80Value = Values::NONE, string $parameter81Name = Values::NONE, string $parameter81Value = Values::NONE, string $parameter82Name = Values::NONE, string $parameter82Value = Values::NONE, string $parameter83Name = Values::NONE, string $parameter83Value = Values::NONE, string $parameter84Name = Values::NONE, string $parameter84Value = Values::NONE, string $parameter85Name = Values::NONE, string $parameter85Value = Values::NONE, string $parameter86Name = Values::NONE, string $parameter86Value = Values::NONE, string $parameter87Name = Values::NONE, string $parameter87Value = Values::NONE, string $parameter88Name = Values::NONE, string $parameter88Value = Values::NONE, string $parameter89Name = Values::NONE, string $parameter89Value = Values::NONE, string $parameter90Name = Values::NONE, string $parameter90Value = Values::NONE, string $parameter91Name = Values::NONE, string $parameter91Value = Values::NONE, string $parameter92Name = Values::NONE, string $parameter92Value = Values::NONE, string $parameter93Name = Values::NONE, string $parameter93Value = Values::NONE, string $parameter94Name = Values::NONE, string $parameter94Value = Values::NONE, string $parameter95Name = Values::NONE, string $parameter95Value = Values::NONE, string $parameter96Name = Values::NONE, string $parameter96Value = Values::NONE, string $parameter97Name = Values::NONE, string $parameter97Value = Values::NONE, string $parameter98Name = Values::NONE, string $parameter98Value = Values::NONE, string $parameter99Name = Values::NONE, string $parameter99Value = Values::NONE) { $this->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 name of this resource * @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; } /** * One of `inbound_track`, `outbound_track`, `both_tracks`. * * @param string $track One of `inbound_track`, `outbound_track`, `both_tracks`. * @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. * @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 . ']'; } } Api/V2010/Account/Call/UserDefinedMessageSubscriptionList.php 0000644 00000005211 15107452335 0017714 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class UserDefinedMessageSubscriptionList extends ListResource { /** * Construct the UserDefinedMessageSubscriptionList * * @param Version $version Version that contains the resource * @param string $accountSid Account SID. * @param string $callSid Call SID. */ public function __construct(Version $version, string $accountSid, string $callSid) { parent::__construct($version); // Path Solution $this->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 to send user defined messages. * @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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new UserDefinedMessageSubscriptionInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['callSid'] ); } /** * Constructs a UserDefinedMessageSubscriptionContext * * @param string $sid User Defined Message Subscription SID. */ 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]'; } } Api/V2010/Account/Call/UserDefinedMessagePage.php 0000644 00000002512 15107452335 0015251 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UserDefinedMessagePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Call/FeedbackSummaryPage.php 0000644 00000002342 15107452335 0014612 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class FeedbackSummaryPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return FeedbackSummaryInstance \Twilio\Rest\Api\V2010\Account\Call\FeedbackSummaryInstance */ public function buildInstance(array $payload): FeedbackSummaryInstance { return new FeedbackSummaryInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.FeedbackSummaryPage]'; } } Api/V2010/Account/Call/FeedbackSummaryInstance.php 0000644 00000011376 15107452335 0015511 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property int $callCount * @property int $callFeedbackCount * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property \DateTime $endDate * @property bool $includeSubaccounts * @property array[] $issues * @property string $qualityScoreAverage * @property string $qualityScoreMedian * @property string $qualityScoreStandardDeviation * @property string $sid * @property \DateTime $startDate * @property string $status */ class FeedbackSummaryInstance extends InstanceResource { /** * Initialize the FeedbackSummaryInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created this resource * @param string $sid A string that uniquely identifies this feedback summary * resource */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'callCount' => Values::array_get($payload, 'call_count'), 'callFeedbackCount' => Values::array_get($payload, 'call_feedback_count'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), 'includeSubaccounts' => Values::array_get($payload, 'include_subaccounts'), 'issues' => Values::array_get($payload, 'issues'), 'qualityScoreAverage' => Values::array_get($payload, 'quality_score_average'), 'qualityScoreMedian' => Values::array_get($payload, 'quality_score_median'), 'qualityScoreStandardDeviation' => Values::array_get($payload, 'quality_score_standard_deviation'), 'sid' => Values::array_get($payload, 'sid'), 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), 'status' => Values::array_get($payload, 'status'), ]; $this->solution = ['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 FeedbackSummaryContext Context for this FeedbackSummaryInstance */ protected function proxy(): FeedbackSummaryContext { if (!$this->context) { $this->context = new FeedbackSummaryContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the FeedbackSummaryInstance * * @return FeedbackSummaryInstance Fetched FeedbackSummaryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FeedbackSummaryInstance { return $this->proxy()->fetch(); } /** * Delete the FeedbackSummaryInstance * * @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.FeedbackSummaryInstance ' . \implode(' ', $context) . ']'; } } Api/V2010/Account/TranscriptionInstance.php 0000644 00000010565 15107452335 0014432 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $duration * @property string $price * @property string $priceUnit * @property string $recordingSid * @property string $sid * @property string $status * @property string $transcriptionText * @property string $type * @property string $uri */ class TranscriptionInstance extends InstanceResource { /** * Initialize the TranscriptionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the TranscriptionInstance * * @return TranscriptionInstance Fetched TranscriptionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TranscriptionInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Api/V2010/Account/Usage/RecordOptions.php 0000644 00000011134 15107452335 0013735 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage; use Twilio\Options; use Twilio\Values; abstract class RecordOptions { /** * @param string $category The usage category of the UsageRecord resources to * read * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts * @return ReadRecordOptions Options builder */ public static function read(string $category = Values::NONE, \DateTime $startDate = Values::NONE, \DateTime $endDate = Values::NONE, bool $includeSubaccounts = Values::NONE): ReadRecordOptions { return new ReadRecordOptions($category, $startDate, $endDate, $includeSubaccounts); } } class ReadRecordOptions extends Options { /** * @param string $category The usage category of the UsageRecord resources to * read * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts */ public function __construct(string $category = Values::NONE, \DateTime $startDate = Values::NONE, \DateTime $endDate = Values::NONE, bool $includeSubaccounts = Values::NONE) { $this->options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['includeSubaccounts'] = $includeSubaccounts; } /** * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * * @param string $category The usage category of the UsageRecord resources to * read * @return $this Fluent Builder */ public function setCategory(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 * @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 * @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 * @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 . ']'; } } Api/V2010/Account/Usage/TriggerContext.php 0000644 00000005551 15107452335 0014121 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class TriggerContext extends InstanceContext { /** * Initialize the TriggerContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Usage/Triggers/' . \rawurlencode($sid) . '.json'; } /** * Fetch the TriggerInstance * * @return TriggerInstance Fetched TriggerInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TriggerInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new TriggerInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Delete the TriggerInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Api/V2010/Account/Usage/TriggerPage.php 0000644 00000002264 15107452335 0013347 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class TriggerPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Usage/RecordPage.php 0000644 00000002256 15107452335 0013163 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RecordPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Usage/Record/YesterdayPage.php 0000644 00000002316 15107452335 0015131 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class YesterdayPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Usage/Record/AllTimePage.php 0000644 00000002302 15107452335 0014502 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AllTimePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Usage/Record/ThisMonthPage.php 0000644 00000002316 15107452335 0015075 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ThisMonthPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Usage/Record/TodayInstance.php 0000644 00000006257 15107452335 0015140 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property string $asOf * @property string $category * @property string $count * @property string $countUnit * @property string $description * @property \DateTime $endDate * @property string $price * @property string $priceUnit * @property \DateTime $startDate * @property array $subresourceUris * @property string $uri * @property string $usage * @property string $usageUnit */ class TodayInstance extends InstanceResource { /** * Initialize the TodayInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Api/V2010/Account/Usage/Record/AllTimeList.php 0000644 00000012233 15107452335 0014545 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class AllTimeList extends ListResource { /** * Construct the AllTimeList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Usage/Records/AllTime.json'; } /** * Streams AllTimeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of AllTimeInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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]'; } } Api/V2010/Account/Usage/Record/AllTimeInstance.php 0000644 00000006265 15107452335 0015406 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property string $asOf * @property string $category * @property string $count * @property string $countUnit * @property string $description * @property \DateTime $endDate * @property string $price * @property string $priceUnit * @property \DateTime $startDate * @property array $subresourceUris * @property string $uri * @property string $usage * @property string $usageUnit */ class AllTimeInstance extends InstanceResource { /** * Initialize the AllTimeInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Api/V2010/Account/Usage/Record/YesterdayInstance.php 0000644 00000006273 15107452335 0016027 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property string $asOf * @property string $category * @property string $count * @property string $countUnit * @property string $description * @property \DateTime $endDate * @property string $price * @property string $priceUnit * @property \DateTime $startDate * @property array $subresourceUris * @property string $uri * @property string $usage * @property string $usageUnit */ class YesterdayInstance extends InstanceResource { /** * Initialize the YesterdayInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Api/V2010/Account/Usage/Record/DailyInstance.php 0000644 00000006257 15107452335 0015122 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property string $asOf * @property string $category * @property string $count * @property string $countUnit * @property string $description * @property \DateTime $endDate * @property string $price * @property string $priceUnit * @property \DateTime $startDate * @property array $subresourceUris * @property string $uri * @property string $usage * @property string $usageUnit */ class DailyInstance extends InstanceResource { /** * Initialize the DailyInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Api/V2010/Account/Usage/Record/YesterdayOptions.php 0000644 00000011165 15107452335 0015712 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Options; use Twilio\Values; abstract class YesterdayOptions { /** * @param string $category The usage category of the UsageRecord resources to * read * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts * @return ReadYesterdayOptions Options builder */ public static function read(string $category = Values::NONE, \DateTime $startDate = Values::NONE, \DateTime $endDate = Values::NONE, bool $includeSubaccounts = Values::NONE): ReadYesterdayOptions { return new ReadYesterdayOptions($category, $startDate, $endDate, $includeSubaccounts); } } class ReadYesterdayOptions extends Options { /** * @param string $category The usage category of the UsageRecord resources to * read * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts */ public function __construct(string $category = Values::NONE, \DateTime $startDate = Values::NONE, \DateTime $endDate = Values::NONE, bool $includeSubaccounts = Values::NONE) { $this->options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['includeSubaccounts'] = $includeSubaccounts; } /** * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * * @param string $category The usage category of the UsageRecord resources to * read * @return $this Fluent Builder */ public function setCategory(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 * @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 * @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 * @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 . ']'; } } Api/V2010/Account/Usage/Record/ThisMonthList.php 0000644 00000012275 15107452335 0015141 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ThisMonthList extends ListResource { /** * Construct the ThisMonthList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Usage/Records/ThisMonth.json'; } /** * Streams ThisMonthInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of ThisMonthInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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]'; } } Api/V2010/Account/Usage/Record/TodayOptions.php 0000644 00000011135 15107452335 0015016 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Options; use Twilio\Values; abstract class TodayOptions { /** * @param string $category The usage category of the UsageRecord resources to * read * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts * @return ReadTodayOptions Options builder */ public static function read(string $category = Values::NONE, \DateTime $startDate = Values::NONE, \DateTime $endDate = Values::NONE, bool $includeSubaccounts = Values::NONE): ReadTodayOptions { return new ReadTodayOptions($category, $startDate, $endDate, $includeSubaccounts); } } class ReadTodayOptions extends Options { /** * @param string $category The usage category of the UsageRecord resources to * read * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts */ public function __construct(string $category = Values::NONE, \DateTime $startDate = Values::NONE, \DateTime $endDate = Values::NONE, bool $includeSubaccounts = Values::NONE) { $this->options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['includeSubaccounts'] = $includeSubaccounts; } /** * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * * @param string $category The usage category of the UsageRecord resources to * read * @return $this Fluent Builder */ public function setCategory(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 * @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 * @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 * @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 . ']'; } } Api/V2010/Account/Usage/Record/TodayList.php 0000644 00000012171 15107452335 0014277 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class TodayList extends ListResource { /** * Construct the TodayList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Usage/Records/Today.json'; } /** * Streams TodayInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of TodayInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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]'; } } Api/V2010/Account/Usage/Record/LastMonthOptions.php 0000644 00000011165 15107452335 0015652 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Options; use Twilio\Values; abstract class LastMonthOptions { /** * @param string $category The usage category of the UsageRecord resources to * read * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts * @return ReadLastMonthOptions Options builder */ public static function read(string $category = Values::NONE, \DateTime $startDate = Values::NONE, \DateTime $endDate = Values::NONE, bool $includeSubaccounts = Values::NONE): ReadLastMonthOptions { return new ReadLastMonthOptions($category, $startDate, $endDate, $includeSubaccounts); } } class ReadLastMonthOptions extends Options { /** * @param string $category The usage category of the UsageRecord resources to * read * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts */ public function __construct(string $category = Values::NONE, \DateTime $startDate = Values::NONE, \DateTime $endDate = Values::NONE, bool $includeSubaccounts = Values::NONE) { $this->options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['includeSubaccounts'] = $includeSubaccounts; } /** * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * * @param string $category The usage category of the UsageRecord resources to * read * @return $this Fluent Builder */ public function setCategory(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 * @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 * @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 * @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 . ']'; } } Api/V2010/Account/Usage/Record/DailyList.php 0000644 00000012171 15107452335 0014261 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class DailyList extends ListResource { /** * Construct the DailyList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Usage/Records/Daily.json'; } /** * Streams DailyInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of DailyInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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]'; } } Api/V2010/Account/Usage/Record/MonthlyPage.php 0000644 00000002302 15107452335 0014605 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MonthlyPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Usage/Record/MonthlyInstance.php 0000644 00000006265 15107452335 0015511 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property string $asOf * @property string $category * @property string $count * @property string $countUnit * @property string $description * @property \DateTime $endDate * @property string $price * @property string $priceUnit * @property \DateTime $startDate * @property array $subresourceUris * @property string $uri * @property string $usage * @property string $usageUnit */ class MonthlyInstance extends InstanceResource { /** * Initialize the MonthlyInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Api/V2010/Account/Usage/Record/LastMonthList.php 0000644 00000012275 15107452335 0015135 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class LastMonthList extends ListResource { /** * Construct the LastMonthList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Usage/Records/LastMonth.json'; } /** * Streams LastMonthInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of LastMonthInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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]'; } } Api/V2010/Account/Usage/Record/LastMonthPage.php 0000644 00000002316 15107452335 0015071 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class LastMonthPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Usage/Record/ThisMonthInstance.php 0000644 00000006273 15107452335 0015773 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property string $asOf * @property string $category * @property string $count * @property string $countUnit * @property string $description * @property \DateTime $endDate * @property string $price * @property string $priceUnit * @property \DateTime $startDate * @property array $subresourceUris * @property string $uri * @property string $usage * @property string $usageUnit */ class ThisMonthInstance extends InstanceResource { /** * Initialize the ThisMonthInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Api/V2010/Account/Usage/Record/TodayPage.php 0000644 00000002266 15107452335 0014244 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class TodayPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Usage/Record/YearlyOptions.php 0000644 00000011143 15107452335 0015202 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Options; use Twilio\Values; abstract class YearlyOptions { /** * @param string $category The usage category of the UsageRecord resources to * read * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts * @return ReadYearlyOptions Options builder */ public static function read(string $category = Values::NONE, \DateTime $startDate = Values::NONE, \DateTime $endDate = Values::NONE, bool $includeSubaccounts = Values::NONE): ReadYearlyOptions { return new ReadYearlyOptions($category, $startDate, $endDate, $includeSubaccounts); } } class ReadYearlyOptions extends Options { /** * @param string $category The usage category of the UsageRecord resources to * read * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts */ public function __construct(string $category = Values::NONE, \DateTime $startDate = Values::NONE, \DateTime $endDate = Values::NONE, bool $includeSubaccounts = Values::NONE) { $this->options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['includeSubaccounts'] = $includeSubaccounts; } /** * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * * @param string $category The usage category of the UsageRecord resources to * read * @return $this Fluent Builder */ public function setCategory(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 * @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 * @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 * @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 . ']'; } } Api/V2010/Account/Usage/Record/MonthlyList.php 0000644 00000012233 15107452335 0014650 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class MonthlyList extends ListResource { /** * Construct the MonthlyList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Usage/Records/Monthly.json'; } /** * Streams MonthlyInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of MonthlyInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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]'; } } Api/V2010/Account/Usage/Record/YearlyInstance.php 0000644 00000006262 15107452335 0015321 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property string $asOf * @property string $category * @property string $count * @property string $countUnit * @property string $description * @property \DateTime $endDate * @property string $price * @property string $priceUnit * @property \DateTime $startDate * @property array $subresourceUris * @property string $uri * @property string $usage * @property string $usageUnit */ class YearlyInstance extends InstanceResource { /** * Initialize the YearlyInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Api/V2010/Account/Usage/Record/AllTimeOptions.php 0000644 00000011151 15107452335 0015263 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Options; use Twilio\Values; abstract class AllTimeOptions { /** * @param string $category The usage category of the UsageRecord resources to * read * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts * @return ReadAllTimeOptions Options builder */ public static function read(string $category = Values::NONE, \DateTime $startDate = Values::NONE, \DateTime $endDate = Values::NONE, bool $includeSubaccounts = Values::NONE): ReadAllTimeOptions { return new ReadAllTimeOptions($category, $startDate, $endDate, $includeSubaccounts); } } class ReadAllTimeOptions extends Options { /** * @param string $category The usage category of the UsageRecord resources to * read * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts */ public function __construct(string $category = Values::NONE, \DateTime $startDate = Values::NONE, \DateTime $endDate = Values::NONE, bool $includeSubaccounts = Values::NONE) { $this->options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['includeSubaccounts'] = $includeSubaccounts; } /** * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * * @param string $category The usage category of the UsageRecord resources to * read * @return $this Fluent Builder */ public function setCategory(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 * @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 * @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 * @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 . ']'; } } Api/V2010/Account/Usage/Record/YearlyList.php 0000644 00000012212 15107452335 0014460 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class YearlyList extends ListResource { /** * Construct the YearlyList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Usage/Records/Yearly.json'; } /** * Streams YearlyInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of YearlyInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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]'; } } Api/V2010/Account/Usage/Record/DailyOptions.php 0000644 00000011135 15107452335 0015000 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Options; use Twilio\Values; abstract class DailyOptions { /** * @param string $category The usage category of the UsageRecord resources to * read * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts * @return ReadDailyOptions Options builder */ public static function read(string $category = Values::NONE, \DateTime $startDate = Values::NONE, \DateTime $endDate = Values::NONE, bool $includeSubaccounts = Values::NONE): ReadDailyOptions { return new ReadDailyOptions($category, $startDate, $endDate, $includeSubaccounts); } } class ReadDailyOptions extends Options { /** * @param string $category The usage category of the UsageRecord resources to * read * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts */ public function __construct(string $category = Values::NONE, \DateTime $startDate = Values::NONE, \DateTime $endDate = Values::NONE, bool $includeSubaccounts = Values::NONE) { $this->options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['includeSubaccounts'] = $includeSubaccounts; } /** * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * * @param string $category The usage category of the UsageRecord resources to * read * @return $this Fluent Builder */ public function setCategory(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 * @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 * @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 * @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 . ']'; } } Api/V2010/Account/Usage/Record/DailyPage.php 0000644 00000002266 15107452335 0014226 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class DailyPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Usage/Record/YearlyPage.php 0000644 00000002274 15107452335 0014430 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class YearlyPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Usage/Record/YesterdayList.php 0000644 00000012275 15107452335 0015175 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class YesterdayList extends ListResource { /** * Construct the YesterdayList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Usage/Records/Yesterday.json'; } /** * Streams YesterdayInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of YesterdayInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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]'; } } Api/V2010/Account/Usage/Record/ThisMonthOptions.php 0000644 00000011165 15107452335 0015656 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Options; use Twilio\Values; abstract class ThisMonthOptions { /** * @param string $category The usage category of the UsageRecord resources to * read * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts * @return ReadThisMonthOptions Options builder */ public static function read(string $category = Values::NONE, \DateTime $startDate = Values::NONE, \DateTime $endDate = Values::NONE, bool $includeSubaccounts = Values::NONE): ReadThisMonthOptions { return new ReadThisMonthOptions($category, $startDate, $endDate, $includeSubaccounts); } } class ReadThisMonthOptions extends Options { /** * @param string $category The usage category of the UsageRecord resources to * read * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts */ public function __construct(string $category = Values::NONE, \DateTime $startDate = Values::NONE, \DateTime $endDate = Values::NONE, bool $includeSubaccounts = Values::NONE) { $this->options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['includeSubaccounts'] = $includeSubaccounts; } /** * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * * @param string $category The usage category of the UsageRecord resources to * read * @return $this Fluent Builder */ public function setCategory(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 * @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 * @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 * @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 . ']'; } } Api/V2010/Account/Usage/Record/LastMonthInstance.php 0000644 00000006273 15107452335 0015767 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property string $asOf * @property string $category * @property string $count * @property string $countUnit * @property string $description * @property \DateTime $endDate * @property string $price * @property string $priceUnit * @property \DateTime $startDate * @property array $subresourceUris * @property string $uri * @property string $usage * @property string $usageUnit */ class LastMonthInstance extends InstanceResource { /** * Initialize the LastMonthInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Api/V2010/Account/Usage/Record/MonthlyOptions.php 0000644 00000011151 15107452335 0015366 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Options; use Twilio\Values; abstract class MonthlyOptions { /** * @param string $category The usage category of the UsageRecord resources to * read * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts * @return ReadMonthlyOptions Options builder */ public static function read(string $category = Values::NONE, \DateTime $startDate = Values::NONE, \DateTime $endDate = Values::NONE, bool $includeSubaccounts = Values::NONE): ReadMonthlyOptions { return new ReadMonthlyOptions($category, $startDate, $endDate, $includeSubaccounts); } } class ReadMonthlyOptions extends Options { /** * @param string $category The usage category of the UsageRecord resources to * read * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts */ public function __construct(string $category = Values::NONE, \DateTime $startDate = Values::NONE, \DateTime $endDate = Values::NONE, bool $includeSubaccounts = Values::NONE) { $this->options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['includeSubaccounts'] = $includeSubaccounts; } /** * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * * @param string $category The usage category of the UsageRecord resources to * read * @return $this Fluent Builder */ public function setCategory(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 * @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 * @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 * @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 . ']'; } } Api/V2010/Account/Usage/TriggerOptions.php 0000644 00000022550 15107452335 0014126 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage; use Twilio\Options; use Twilio\Values; abstract class TriggerOptions { /** * @param string $callbackMethod The HTTP method to use to call callback_url * @param string $callbackUrl The URL we call when the trigger fires * @param string $friendlyName A string to describe the resource * @return UpdateTriggerOptions Options builder */ public static function update(string $callbackMethod = Values::NONE, string $callbackUrl = Values::NONE, string $friendlyName = Values::NONE): UpdateTriggerOptions { return new UpdateTriggerOptions($callbackMethod, $callbackUrl, $friendlyName); } /** * @param string $callbackMethod The HTTP method to use to call callback_url * @param string $friendlyName A string to describe the resource * @param string $recurring The frequency of a recurring UsageTrigger * @param string $triggerBy The field in the UsageRecord resource that fires * the trigger * @return CreateTriggerOptions Options builder */ public static function create(string $callbackMethod = Values::NONE, string $friendlyName = Values::NONE, string $recurring = Values::NONE, string $triggerBy = Values::NONE): CreateTriggerOptions { return new CreateTriggerOptions($callbackMethod, $friendlyName, $recurring, $triggerBy); } /** * @param string $recurring The frequency of recurring UsageTriggers to read * @param string $triggerBy The trigger field of the UsageTriggers to read * @param string $usageCategory The usage category of the UsageTriggers to read * @return ReadTriggerOptions Options builder */ public static function read(string $recurring = Values::NONE, string $triggerBy = Values::NONE, string $usageCategory = Values::NONE): ReadTriggerOptions { return new ReadTriggerOptions($recurring, $triggerBy, $usageCategory); } } class UpdateTriggerOptions extends Options { /** * @param string $callbackMethod The HTTP method to use to call callback_url * @param string $callbackUrl The URL we call when the trigger fires * @param string $friendlyName A string to describe the resource */ public function __construct(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 to use to call callback_url * @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 call 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 string to describe the resource * @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 . ']'; } } class CreateTriggerOptions extends Options { /** * @param string $callbackMethod The HTTP method to use to call callback_url * @param string $friendlyName A string to describe the resource * @param string $recurring The frequency of a recurring UsageTrigger * @param string $triggerBy The field in the UsageRecord resource that fires * the trigger */ public function __construct(string $callbackMethod = Values::NONE, string $friendlyName = Values::NONE, string $recurring = Values::NONE, string $triggerBy = Values::NONE) { $this->options['callbackMethod'] = $callbackMethod; $this->options['friendlyName'] = $friendlyName; $this->options['recurring'] = $recurring; $this->options['triggerBy'] = $triggerBy; } /** * The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is `POST`. * * @param string $callbackMethod The HTTP method to use to call callback_url * @return $this Fluent Builder */ public function setCallbackMethod(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 string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The frequency of a recurring UsageTrigger. Can be: `daily`, `monthly`, or `yearly` for recurring triggers or empty for non-recurring triggers. A trigger will only fire once during each period. Recurring times are in GMT. * * @param string $recurring The frequency of a recurring UsageTrigger * @return $this Fluent Builder */ public function setRecurring(string $recurring): self { $this->options['recurring'] = $recurring; return $this; } /** * The field in the [UsageRecord](https://www.twilio.com/docs/usage/api/usage-record) resource that should fire the trigger. Can be: `count`, `usage`, or `price` as described in the [UsageRecords documentation](https://www.twilio.com/docs/usage/api/usage-record#usage-count-price). The default is `usage`. * * @param string $triggerBy The field in the UsageRecord resource that fires * the trigger * @return $this Fluent Builder */ public function setTriggerBy(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 * @param string $triggerBy The trigger field of the UsageTriggers to read * @param string $usageCategory The usage category of the UsageTriggers to read */ public function __construct(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 * @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 * @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 * @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 . ']'; } } Api/V2010/Account/Usage/RecordList.php 0000644 00000022612 15107452335 0013220 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Api\V2010\Account\Usage\Record\AllTimeList; use Twilio\Rest\Api\V2010\Account\Usage\Record\DailyList; use Twilio\Rest\Api\V2010\Account\Usage\Record\LastMonthList; use Twilio\Rest\Api\V2010\Account\Usage\Record\MonthlyList; use Twilio\Rest\Api\V2010\Account\Usage\Record\ThisMonthList; use Twilio\Rest\Api\V2010\Account\Usage\Record\TodayList; use Twilio\Rest\Api\V2010\Account\Usage\Record\YearlyList; use Twilio\Rest\Api\V2010\Account\Usage\Record\YesterdayList; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * @property AllTimeList $allTime * @property DailyList $daily * @property LastMonthList $lastMonth * @property MonthlyList $monthly * @property ThisMonthList $thisMonth * @property TodayList $today * @property YearlyList $yearly * @property YesterdayList $yesterday */ class RecordList extends ListResource { protected $_allTime = null; protected $_daily = null; protected $_lastMonth = null; protected $_monthly = null; protected $_thisMonth = null; protected $_today = null; protected $_yearly = null; protected $_yesterday = null; /** * Construct the RecordList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Usage/Records.json'; } /** * Streams RecordInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of RecordInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 allTime */ protected function getAllTime(): AllTimeList { if (!$this->_allTime) { $this->_allTime = new AllTimeList($this->version, $this->solution['accountSid']); } return $this->_allTime; } /** * Access the daily */ protected function getDaily(): DailyList { if (!$this->_daily) { $this->_daily = new DailyList($this->version, $this->solution['accountSid']); } return $this->_daily; } /** * Access the lastMonth */ protected function getLastMonth(): LastMonthList { if (!$this->_lastMonth) { $this->_lastMonth = new LastMonthList($this->version, $this->solution['accountSid']); } return $this->_lastMonth; } /** * Access the monthly */ protected function getMonthly(): MonthlyList { if (!$this->_monthly) { $this->_monthly = new MonthlyList($this->version, $this->solution['accountSid']); } return $this->_monthly; } /** * Access the thisMonth */ protected function getThisMonth(): ThisMonthList { if (!$this->_thisMonth) { $this->_thisMonth = new ThisMonthList($this->version, $this->solution['accountSid']); } return $this->_thisMonth; } /** * 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 yesterday */ protected function getYesterday(): YesterdayList { if (!$this->_yesterday) { $this->_yesterday = new YesterdayList($this->version, $this->solution['accountSid']); } return $this->_yesterday; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(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]'; } } Api/V2010/Account/Usage/TriggerInstance.php 0000644 00000012160 15107452335 0014233 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property string $callbackMethod * @property string $callbackUrl * @property string $currentValue * @property \DateTime $dateCreated * @property \DateTime $dateFired * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $recurring * @property string $sid * @property string $triggerBy * @property string $triggerValue * @property string $uri * @property string $usageCategory * @property string $usageRecordUri */ class TriggerInstance extends InstanceResource { /** * Initialize the TriggerInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Api/V2010/Account/Usage/RecordInstance.php 0000644 00000006253 15107452335 0014054 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property string $asOf * @property string $category * @property string $count * @property string $countUnit * @property string $description * @property \DateTime $endDate * @property string $price * @property string $priceUnit * @property \DateTime $startDate * @property array $subresourceUris * @property string $uri * @property string $usage * @property string $usageUnit */ class RecordInstance extends InstanceResource { /** * Initialize the RecordInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Api/V2010/Account/Usage/TriggerList.php 0000644 00000014755 15107452335 0013416 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class TriggerList extends ListResource { /** * Construct the TriggerList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Usage/Triggers.json'; } /** * Create the TriggerInstance * * @param string $callbackUrl The URL we call when the trigger fires * @param string $triggerValue The usage value at which the trigger should fire * @param string $usageCategory The usage category the trigger watches * @param array|Options $options Optional Arguments * @return TriggerInstance 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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new TriggerInstance($this->version, $payload, $this->solution['accountSid']); } /** * Streams TriggerInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of TriggerInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 unique string that identifies the resource */ 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]'; } } Api/V2010/Account/ConnectAppList.php 0000644 00000011423 15107452335 0012766 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ConnectAppList extends ListResource { /** * Construct the ConnectAppList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/ConnectApps.json'; } /** * Streams ConnectAppInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 unique string that identifies the resource */ 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]'; } } Api/V2010/Account/TokenInstance.php 0000644 00000004574 15107452335 0012656 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string[] $iceServers * @property string $password * @property string $ttl * @property string $username */ class TokenInstance extends InstanceResource { /** * Initialize the TokenInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Api/V2010/Account/ConnectAppOptions.php 0000644 00000016255 15107452335 0013516 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class ConnectAppOptions { /** * @param string $authorizeRedirectUrl The URL to redirect the user to after * authorization * @param string $companyName The company name to set for the Connect App * @param string $deauthorizeCallbackMethod The HTTP method to use when calling * deauthorize_callback_url * @param string $deauthorizeCallbackUrl The URL to call to de-authorize the * Connect App * @param string $description A description of the Connect App * @param string $friendlyName A string to describe the resource * @param string $homepageUrl A public URL where users can obtain more * information * @param string[] $permissions The set of permissions that your ConnectApp * will request * @return UpdateConnectAppOptions Options builder */ public static function update(string $authorizeRedirectUrl = Values::NONE, string $companyName = Values::NONE, string $deauthorizeCallbackMethod = Values::NONE, string $deauthorizeCallbackUrl = Values::NONE, string $description = Values::NONE, string $friendlyName = Values::NONE, string $homepageUrl = Values::NONE, array $permissions = Values::ARRAY_NONE): UpdateConnectAppOptions { return new UpdateConnectAppOptions($authorizeRedirectUrl, $companyName, $deauthorizeCallbackMethod, $deauthorizeCallbackUrl, $description, $friendlyName, $homepageUrl, $permissions); } } class UpdateConnectAppOptions extends Options { /** * @param string $authorizeRedirectUrl The URL to redirect the user to after * authorization * @param string $companyName The company name to set for the Connect App * @param string $deauthorizeCallbackMethod The HTTP method to use when calling * deauthorize_callback_url * @param string $deauthorizeCallbackUrl The URL to call to de-authorize the * Connect App * @param string $description A description of the Connect App * @param string $friendlyName A string to describe the resource * @param string $homepageUrl A public URL where users can obtain more * information * @param string[] $permissions The set of permissions that your ConnectApp * will request */ public function __construct(string $authorizeRedirectUrl = Values::NONE, string $companyName = Values::NONE, string $deauthorizeCallbackMethod = Values::NONE, string $deauthorizeCallbackUrl = Values::NONE, string $description = Values::NONE, string $friendlyName = Values::NONE, string $homepageUrl = Values::NONE, array $permissions = Values::ARRAY_NONE) { $this->options['authorizeRedirectUrl'] = $authorizeRedirectUrl; $this->options['companyName'] = $companyName; $this->options['deauthorizeCallbackMethod'] = $deauthorizeCallbackMethod; $this->options['deauthorizeCallbackUrl'] = $deauthorizeCallbackUrl; $this->options['description'] = $description; $this->options['friendlyName'] = $friendlyName; $this->options['homepageUrl'] = $homepageUrl; $this->options['permissions'] = $permissions; } /** * The URL to redirect the user to after we authenticate the user and obtain authorization to access the Connect App. * * @param string $authorizeRedirectUrl The URL to redirect the user to after * authorization * @return $this Fluent Builder */ public function setAuthorizeRedirectUrl(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 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 string to describe the resource * @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 * @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 The set of permissions that your ConnectApp * will request * @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 . ']'; } } Api/V2010/Account/Recording/TranscriptionContext.php 0000644 00000004600 15107452335 0016217 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Recording; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class TranscriptionContext extends InstanceContext { /** * Initialize the TranscriptionContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $recordingSid The SID of the recording that created the * transcriptions to fetch * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $accountSid, $recordingSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'recordingSid' => $recordingSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Recordings/' . \rawurlencode($recordingSid) . '/Transcriptions/' . \rawurlencode($sid) . '.json'; } /** * Fetch the TranscriptionInstance * * @return TranscriptionInstance Fetched TranscriptionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TranscriptionInstance { $payload = $this->version->fetch('GET', $this->uri); return new TranscriptionInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['recordingSid'], $this->solution['sid'] ); } /** * Delete the TranscriptionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Api/V2010/Account/Recording/AddOnResult/PayloadList.php 0000644 00000012715 15107452335 0016432 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Recording\AddOnResult; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class PayloadList extends ListResource { /** * Construct the PayloadList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @param string $referenceSid The SID of the recording to which the * AddOnResult resource that contains the payload * belongs * @param string $addOnResultSid The SID of the AddOnResult to which the * payload belongs */ public function __construct(Version $version, string $accountSid, string $referenceSid, string $addOnResultSid) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'referenceSid' => $referenceSid, 'addOnResultSid' => $addOnResultSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Recordings/' . \rawurlencode($referenceSid) . '/AddOnResults/' . \rawurlencode($addOnResultSid) . '/Payloads.json'; } /** * Streams PayloadInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 unique string that identifies the resource to fetch */ 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]'; } } Api/V2010/Account/Recording/AddOnResult/PayloadPage.php 0000644 00000002536 15107452335 0016373 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Recording\AddOnResult; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class PayloadPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Recording/AddOnResult/PayloadInstance.php 0000644 00000011475 15107452335 0017265 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Recording\AddOnResult; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $addOnResultSid * @property string $accountSid * @property string $label * @property string $addOnSid * @property string $addOnConfigurationSid * @property string $contentType * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $referenceSid * @property array $subresourceUris */ class PayloadInstance extends InstanceResource { /** * Initialize the PayloadInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $referenceSid The SID of the recording to which the * AddOnResult resource that contains the payload * belongs * @param string $addOnResultSid The SID of the AddOnResult to which the * payload belongs * @param string $sid The unique string that identifies the resource to fetch */ public function __construct(Version $version, array $payload, string $accountSid, string $referenceSid, string $addOnResultSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the PayloadInstance * * @return PayloadInstance Fetched PayloadInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PayloadInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Api/V2010/Account/Recording/AddOnResult/PayloadContext.php 0000644 00000005375 15107452335 0017147 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Recording\AddOnResult; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class PayloadContext extends InstanceContext { /** * Initialize the PayloadContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $referenceSid The SID of the recording to which the * AddOnResult resource that contains the payload * to fetch belongs * @param string $addOnResultSid The SID of the AddOnResult to which the * payload to fetch belongs * @param string $sid The unique string that identifies the resource to fetch */ public function __construct(Version $version, $accountSid, $referenceSid, $addOnResultSid, $sid) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'referenceSid' => $referenceSid, 'addOnResultSid' => $addOnResultSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Recordings/' . \rawurlencode($referenceSid) . '/AddOnResults/' . \rawurlencode($addOnResultSid) . '/Payloads/' . \rawurlencode($sid) . '.json'; } /** * Fetch the PayloadInstance * * @return PayloadInstance Fetched PayloadInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PayloadInstance { $payload = $this->version->fetch('GET', $this->uri); return new PayloadInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['referenceSid'], $this->solution['addOnResultSid'], $this->solution['sid'] ); } /** * Delete the PayloadInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Api/V2010/Account/Recording/TranscriptionList.php 0000644 00000012227 15107452335 0015512 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Recording; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class TranscriptionList extends ListResource { /** * Construct the TranscriptionList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @param string $recordingSid The SID that identifies the transcription's * recording */ public function __construct(Version $version, string $accountSid, string $recordingSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'recordingSid' => $recordingSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Recordings/' . \rawurlencode($recordingSid) . '/Transcriptions.json'; } /** * Streams TranscriptionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 unique string that identifies the resource */ 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]'; } } Api/V2010/Account/Recording/AddOnResultPage.php 0000644 00000002457 15107452335 0015004 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Recording; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AddOnResultPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Recording/TranscriptionPage.php 0000644 00000002473 15107452335 0015455 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Recording; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class TranscriptionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Recording/AddOnResultList.php 0000644 00000012205 15107452335 0015033 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Recording; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class AddOnResultList extends ListResource { /** * Construct the AddOnResultList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @param string $referenceSid The SID of the recording to which the * AddOnResult resource belongs */ public function __construct(Version $version, string $accountSid, string $referenceSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'referenceSid' => $referenceSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Recordings/' . \rawurlencode($referenceSid) . '/AddOnResults.json'; } /** * Streams AddOnResultInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 unique string that identifies the resource to fetch */ 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]'; } } Api/V2010/Account/Recording/AddOnResultContext.php 0000644 00000010170 15107452335 0015543 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Recording; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Api\V2010\Account\Recording\AddOnResult\PayloadList; use Twilio\Values; use Twilio\Version; /** * @property PayloadList $payloads * @method \Twilio\Rest\Api\V2010\Account\Recording\AddOnResult\PayloadContext payloads(string $sid) */ class AddOnResultContext extends InstanceContext { protected $_payloads; /** * Initialize the AddOnResultContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $referenceSid The SID of the recording to which the result to * fetch belongs * @param string $sid The unique string that identifies the resource to fetch */ public function __construct(Version $version, $accountSid, $referenceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'referenceSid' => $referenceSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Recordings/' . \rawurlencode($referenceSid) . '/AddOnResults/' . \rawurlencode($sid) . '.json'; } /** * Fetch the AddOnResultInstance * * @return AddOnResultInstance Fetched AddOnResultInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AddOnResultInstance { $payload = $this->version->fetch('GET', $this->uri); return new AddOnResultInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['referenceSid'], $this->solution['sid'] ); } /** * Delete the AddOnResultInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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) . ']'; } } Api/V2010/Account/Recording/TranscriptionInstance.php 0000644 00000011220 15107452335 0016333 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Recording; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $duration * @property string $price * @property string $priceUnit * @property string $recordingSid * @property string $sid * @property string $status * @property string $transcriptionText * @property string $type * @property string $uri */ class TranscriptionInstance extends InstanceResource { /** * Initialize the TranscriptionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $recordingSid The SID that identifies the transcription's * recording * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $accountSid, string $recordingSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the TranscriptionInstance * * @return TranscriptionInstance Fetched TranscriptionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TranscriptionInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Api/V2010/Account/Recording/AddOnResultInstance.php 0000644 00000011302 15107452335 0015661 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Recording; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Rest\Api\V2010\Account\Recording\AddOnResult\PayloadList; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $status * @property string $addOnSid * @property string $addOnConfigurationSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property \DateTime $dateCompleted * @property string $referenceSid * @property array $subresourceUris */ class AddOnResultInstance extends InstanceResource { protected $_payloads; /** * Initialize the AddOnResultInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $referenceSid The SID of the recording to which the * AddOnResult resource belongs * @param string $sid The unique string that identifies the resource to fetch */ public function __construct(Version $version, array $payload, string $accountSid, string $referenceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the AddOnResultInstance * * @return AddOnResultInstance Fetched AddOnResultInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AddOnResultInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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) . ']'; } } Api/V2010/Account/KeyInstance.php 0000644 00000007437 15107452335 0012327 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated */ class KeyInstance extends InstanceResource { /** * Initialize the KeyInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Api/V2010/Account/KeyPage.php 0000644 00000002220 15107452335 0011420 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class KeyPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnList.php 0000644 00000014043 15107452335 0017306 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class AssignedAddOnList extends ListResource { /** * Construct the AssignedAddOnList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @param string $resourceSid The SID of the Phone Number that installed this * Add-on */ public function __construct(Version $version, string $accountSid, string $resourceSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'resourceSid' => $resourceSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/IncomingPhoneNumbers/' . \rawurlencode($resourceSid) . '/AssignedAddOns.json'; } /** * Streams AssignedAddOnInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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); } /** * 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, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AssignedAddOnInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['resourceSid'] ); } /** * Constructs a AssignedAddOnContext * * @param string $sid The unique string that identifies the resource */ 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]'; } } Api/V2010/Account/IncomingPhoneNumber/LocalPage.php 0000644 00000002304 15107452335 0015633 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class LocalPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/IncomingPhoneNumber/LocalList.php 0000644 00000016035 15107452335 0015700 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class LocalList extends ListResource { /** * Construct the LocalList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/IncomingPhoneNumbers/Local.json'; } /** * Streams LocalInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of LocalInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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); } /** * Create the LocalInstance * * @param string $phoneNumber The phone number to purchase in E.164 format * @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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); 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.LocalList]'; } } Api/V2010/Account/IncomingPhoneNumber/LocalInstance.php 0000644 00000012615 15107452335 0016531 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $addressSid * @property string $addressRequirements * @property string $apiVersion * @property bool $beta * @property string $capabilities * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $identitySid * @property string $phoneNumber * @property string $origin * @property string $sid * @property string $smsApplicationSid * @property string $smsFallbackMethod * @property string $smsFallbackUrl * @property string $smsMethod * @property string $smsUrl * @property string $statusCallback * @property string $statusCallbackMethod * @property string $trunkSid * @property string $uri * @property string $voiceReceiveMode * @property string $voiceApplicationSid * @property bool $voiceCallerIdLookup * @property string $voiceFallbackMethod * @property string $voiceFallbackUrl * @property string $voiceMethod * @property string $voiceUrl * @property string $emergencyStatus * @property string $emergencyAddressSid * @property string $emergencyAddressStatus * @property string $bundleSid * @property string $status */ class LocalInstance extends InstanceResource { /** * Initialize the LocalInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); // Marshaled Properties $this->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' => 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]'; } } Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnContext.php 0000644 00000010547 15107452335 0020024 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOn\AssignedAddOnExtensionList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property AssignedAddOnExtensionList $extensions * @method \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOn\AssignedAddOnExtensionContext extensions(string $sid) */ class AssignedAddOnContext extends InstanceContext { protected $_extensions; /** * Initialize the AssignedAddOnContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $resourceSid The SID of the Phone Number that installed this * Add-on * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $accountSid, $resourceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'resourceSid' => $resourceSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/IncomingPhoneNumbers/' . \rawurlencode($resourceSid) . '/AssignedAddOns/' . \rawurlencode($sid) . '.json'; } /** * Fetch the AssignedAddOnInstance * * @return AssignedAddOnInstance Fetched AssignedAddOnInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AssignedAddOnInstance { $payload = $this->version->fetch('GET', $this->uri); return new AssignedAddOnInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['resourceSid'], $this->solution['sid'] ); } /** * Delete the AssignedAddOnInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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) . ']'; } } Api/V2010/Account/IncomingPhoneNumber/TollFreePage.php 0000644 00000002326 15107452335 0016321 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class TollFreePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/IncomingPhoneNumber/MobileList.php 0000644 00000016063 15107452335 0016056 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class MobileList extends ListResource { /** * Construct the MobileList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/IncomingPhoneNumbers/Mobile.json'; } /** * Streams MobileInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of MobileInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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); } /** * Create the MobileInstance * * @param string $phoneNumber The phone number to purchase in E.164 format * @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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); 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.MobileList]'; } } Api/V2010/Account/IncomingPhoneNumber/MobileOptions.php 0000644 00000055611 15107452335 0016600 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Options; use Twilio\Values; abstract class MobileOptions { /** * @param bool $beta Whether to include new phone numbers * @param string $friendlyName A string that identifies the resources to read * @param string $phoneNumber The phone numbers of the resources to read * @param string $origin Include phone numbers based on their origin. By * default, phone numbers of all origin are included. * @return ReadMobileOptions Options builder */ public static function read(bool $beta = Values::NONE, string $friendlyName = Values::NONE, string $phoneNumber = Values::NONE, string $origin = Values::NONE): ReadMobileOptions { return new ReadMobileOptions($beta, $friendlyName, $phoneNumber, $origin); } /** * @param string $apiVersion The API version to use for incoming calls made to * the new phone number * @param string $friendlyName A string to describe the new phone number * @param string $smsApplicationSid The SID of the application to handle SMS * messages * @param string $smsFallbackMethod HTTP method used with sms_fallback_url * @param string $smsFallbackUrl The URL we call when an error occurs while * executing TwiML * @param string $smsMethod The HTTP method to use with sms url * @param string $smsUrl The URL we should call when the new phone number * receives an incoming SMS message * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @param string $voiceApplicationSid The SID of the application to handle the * new phone number * @param bool $voiceCallerIdLookup Whether to lookup the caller's name * @param string $voiceFallbackMethod The HTTP method used with * voice_fallback_url * @param string $voiceFallbackUrl The URL we will call when an error occurs in * TwiML * @param string $voiceMethod The HTTP method used with the voice_url * @param string $voiceUrl The URL we should call when the phone number * receives a call * @param string $identitySid The SID of the Identity resource to associate * with the new phone number * @param string $addressSid The SID of the Address resource associated with * the phone number * @param string $emergencyStatus Displays if emergency calling is enabled for * this number. * @param string $emergencyAddressSid The emergency address configuration to * use for emergency calling * @param string $trunkSid SID of the trunk to handle calls to the new phone * number * @param string $voiceReceiveMode Incoming call type: fax or voice * @param string $bundleSid The SID of the Bundle resource associated with * number * @return CreateMobileOptions Options builder */ public static function create(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::NONE, string $voiceFallbackMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceUrl = Values::NONE, string $identitySid = Values::NONE, string $addressSid = Values::NONE, string $emergencyStatus = Values::NONE, string $emergencyAddressSid = Values::NONE, string $trunkSid = Values::NONE, string $voiceReceiveMode = Values::NONE, string $bundleSid = Values::NONE): CreateMobileOptions { return new CreateMobileOptions($apiVersion, $friendlyName, $smsApplicationSid, $smsFallbackMethod, $smsFallbackUrl, $smsMethod, $smsUrl, $statusCallback, $statusCallbackMethod, $voiceApplicationSid, $voiceCallerIdLookup, $voiceFallbackMethod, $voiceFallbackUrl, $voiceMethod, $voiceUrl, $identitySid, $addressSid, $emergencyStatus, $emergencyAddressSid, $trunkSid, $voiceReceiveMode, $bundleSid); } } class ReadMobileOptions extends Options { /** * @param bool $beta Whether to include new phone numbers * @param string $friendlyName A string that identifies the resources to read * @param string $phoneNumber The phone numbers of the resources to read * @param string $origin Include phone numbers based on their origin. By * default, phone numbers of all origin are included. */ public function __construct(bool $beta = Values::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 new phone numbers * @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 resources to read * @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 Include phone numbers based on their origin. 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 . ']'; } } class CreateMobileOptions extends Options { /** * @param string $apiVersion The API version to use for incoming calls made to * the new phone number * @param string $friendlyName A string to describe the new phone number * @param string $smsApplicationSid The SID of the application to handle SMS * messages * @param string $smsFallbackMethod HTTP method used with sms_fallback_url * @param string $smsFallbackUrl The URL we call when an error occurs while * executing TwiML * @param string $smsMethod The HTTP method to use with sms url * @param string $smsUrl The URL we should call when the new phone number * receives an incoming SMS message * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @param string $voiceApplicationSid The SID of the application to handle the * new phone number * @param bool $voiceCallerIdLookup Whether to lookup the caller's name * @param string $voiceFallbackMethod The HTTP method used with * voice_fallback_url * @param string $voiceFallbackUrl The URL we will call when an error occurs in * TwiML * @param string $voiceMethod The HTTP method used with the voice_url * @param string $voiceUrl The URL we should call when the phone number * receives a call * @param string $identitySid The SID of the Identity resource to associate * with the new phone number * @param string $addressSid The SID of the Address resource associated with * the phone number * @param string $emergencyStatus Displays if emergency calling is enabled for * this number. * @param string $emergencyAddressSid The emergency address configuration to * use for emergency calling * @param string $trunkSid SID of the trunk to handle calls to the new phone * number * @param string $voiceReceiveMode Incoming call type: fax or voice * @param string $bundleSid The SID of the Bundle resource associated with * number */ public function __construct(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::NONE, string $voiceFallbackMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceUrl = Values::NONE, string $identitySid = Values::NONE, string $addressSid = Values::NONE, string $emergencyStatus = Values::NONE, string $emergencyAddressSid = Values::NONE, string $trunkSid = Values::NONE, string $voiceReceiveMode = Values::NONE, string $bundleSid = Values::NONE) { $this->options['apiVersion'] = $apiVersion; $this->options['friendlyName'] = $friendlyName; $this->options['smsApplicationSid'] = $smsApplicationSid; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsUrl'] = $smsUrl; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['voiceApplicationSid'] = $voiceApplicationSid; $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceUrl'] = $voiceUrl; $this->options['identitySid'] = $identitySid; $this->options['addressSid'] = $addressSid; $this->options['emergencyStatus'] = $emergencyStatus; $this->options['emergencyAddressSid'] = $emergencyAddressSid; $this->options['trunkSid'] = $trunkSid; $this->options['voiceReceiveMode'] = $voiceReceiveMode; $this->options['bundleSid'] = $bundleSid; } /** * The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. * * @param string $apiVersion The API version to use for incoming calls made to * the new phone number * @return $this Fluent Builder */ public function setApiVersion(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 string to describe 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 of the application. * * @param string $smsApplicationSid The SID of the application to handle SMS * messages * @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 HTTP method used with sms_fallback_url * @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 we call when an error occurs while * executing TwiML * @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 to use with sms url * @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 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 * @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 to handle the * new phone number * @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 * @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 used with * voice_fallback_url * @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 we will call when an error occurs in * TwiML * @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 used with the voice_url * @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 we should call when the phone number * receives a call * @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 to associate * with the new phone number * @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 associated with * the phone number * @return $this Fluent Builder */ public function setAddressSid(string $addressSid): self { $this->options['addressSid'] = $addressSid; return $this; } /** * The parameter displays if emergency calling is enabled for this number. Active numbers may place emergency calls by dialing valid emergency numbers for the country. * * @param string $emergencyStatus Displays if emergency calling is enabled for * this number. * @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 emergency address configuration to * use for emergency calling * @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 SID of the trunk to handle calls to the new phone * number * @return $this Fluent Builder */ public function setTrunkSid(string $trunkSid): self { $this->options['trunkSid'] = $trunkSid; return $this; } /** * The configuration parameter for the new phone number to receive incoming voice calls or faxes. Can be: `fax` or `voice` and defaults to `voice`. * * @param string $voiceReceiveMode Incoming call type: fax or voice * @return $this Fluent Builder */ public function setVoiceReceiveMode(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 associated with * number * @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 . ']'; } } Api/V2010/Account/IncomingPhoneNumber/TollFreeInstance.php 0000644 00000012626 15107452335 0017215 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $addressSid * @property string $addressRequirements * @property string $apiVersion * @property bool $beta * @property string $capabilities * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $identitySid * @property string $phoneNumber * @property string $origin * @property string $sid * @property string $smsApplicationSid * @property string $smsFallbackMethod * @property string $smsFallbackUrl * @property string $smsMethod * @property string $smsUrl * @property string $statusCallback * @property string $statusCallbackMethod * @property string $trunkSid * @property string $uri * @property string $voiceReceiveMode * @property string $voiceApplicationSid * @property bool $voiceCallerIdLookup * @property string $voiceFallbackMethod * @property string $voiceFallbackUrl * @property string $voiceMethod * @property string $voiceUrl * @property string $emergencyStatus * @property string $emergencyAddressSid * @property string $emergencyAddressStatus * @property string $bundleSid * @property string $status */ class TollFreeInstance extends InstanceResource { /** * Initialize the TollFreeInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); // Marshaled Properties $this->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' => 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]'; } } Api/V2010/Account/IncomingPhoneNumber/MobileInstance.php 0000644 00000012620 15107452335 0016702 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $addressSid * @property string $addressRequirements * @property string $apiVersion * @property bool $beta * @property string $capabilities * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $identitySid * @property string $phoneNumber * @property string $origin * @property string $sid * @property string $smsApplicationSid * @property string $smsFallbackMethod * @property string $smsFallbackUrl * @property string $smsMethod * @property string $smsUrl * @property string $statusCallback * @property string $statusCallbackMethod * @property string $trunkSid * @property string $uri * @property string $voiceReceiveMode * @property string $voiceApplicationSid * @property bool $voiceCallerIdLookup * @property string $voiceFallbackMethod * @property string $voiceFallbackUrl * @property string $voiceMethod * @property string $voiceUrl * @property string $emergencyStatus * @property string $emergencyAddressSid * @property string $emergencyAddressStatus * @property string $bundleSid * @property string $status */ class MobileInstance extends InstanceResource { /** * Initialize the MobileInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); // Marshaled Properties $this->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' => 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]'; } } Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionList.php 0000644 00000013516 15107452335 0023652 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOn; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class AssignedAddOnExtensionList extends ListResource { /** * Construct the AssignedAddOnExtensionList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @param string $resourceSid The SID of the Phone Number to which the Add-on * is assigned * @param string $assignedAddOnSid The SID that uniquely identifies the * assigned Add-on installation */ public function __construct(Version $version, string $accountSid, string $resourceSid, string $assignedAddOnSid) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'resourceSid' => $resourceSid, 'assignedAddOnSid' => $assignedAddOnSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/IncomingPhoneNumbers/' . \rawurlencode($resourceSid) . '/AssignedAddOns/' . \rawurlencode($assignedAddOnSid) . '/Extensions.json'; } /** * Streams AssignedAddOnExtensionInstance records from the API as a generator * stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 unique string that identifies the resource */ 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]'; } } Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionInstance.php 0000644 00000010756 15107452335 0024506 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOn; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $resourceSid * @property string $assignedAddOnSid * @property string $friendlyName * @property string $productName * @property string $uniqueName * @property string $uri * @property bool $enabled */ class AssignedAddOnExtensionInstance extends InstanceResource { /** * Initialize the AssignedAddOnExtensionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $resourceSid The SID of the Phone Number to which the Add-on * is assigned * @param string $assignedAddOnSid The SID that uniquely identifies the * assigned Add-on installation * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $accountSid, string $resourceSid, string $assignedAddOnSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionContext.php 0000644 00000005231 15107452335 0024356 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOn; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class AssignedAddOnExtensionContext extends InstanceContext { /** * Initialize the AssignedAddOnExtensionContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $resourceSid The SID of the Phone Number to which the Add-on * is assigned * @param string $assignedAddOnSid The SID that uniquely identifies the * assigned Add-on installation * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $accountSid, $resourceSid, $assignedAddOnSid, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionPage.php 0000644 00000003102 15107452335 0023601 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOn; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class AssignedAddOnExtensionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/IncomingPhoneNumber/LocalOptions.php 0000644 00000056007 15107452335 0016423 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Options; use Twilio\Values; abstract class LocalOptions { /** * @param bool $beta Whether to include new phone numbers * @param string $friendlyName A string that identifies the resources to read * @param string $phoneNumber The phone numbers of the resources to read * @param string $origin Include phone numbers based on their origin. By * default, phone numbers of all origin are included. * @return ReadLocalOptions Options builder */ public static function read(bool $beta = Values::NONE, string $friendlyName = Values::NONE, string $phoneNumber = Values::NONE, string $origin = Values::NONE): ReadLocalOptions { return new ReadLocalOptions($beta, $friendlyName, $phoneNumber, $origin); } /** * @param string $apiVersion The API version to use for incoming calls made to * the new phone number * @param string $friendlyName A string to describe the new phone number * @param string $smsApplicationSid The SID of the application to handle SMS * messages * @param string $smsFallbackMethod The HTTP method we use to call * status_callback * @param string $smsFallbackUrl The URL we call when an error occurs while * executing TwiML * @param string $smsMethod The HTTP method to use with sms url * @param string $smsUrl The URL we should call when the new phone number * receives an incoming SMS message * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod HTTP method we should use to call * status_callback * @param string $voiceApplicationSid The SID of the application to handle the * new phone number * @param bool $voiceCallerIdLookup Whether to lookup the caller's name * @param string $voiceFallbackMethod The HTTP method used with * voice_fallback_url * @param string $voiceFallbackUrl The URL we will call when an error occurs in * TwiML * @param string $voiceMethod The HTTP method used with the voice_url * @param string $voiceUrl The URL we should call when the phone number * receives a call * @param string $identitySid The SID of the Identity resource to associate * with the new phone number * @param string $addressSid The SID of the Address resource associated with * the phone number * @param string $emergencyStatus Displays if emergency calling is enabled for * this number. * @param string $emergencyAddressSid The emergency address configuration to * use for emergency calling * @param string $trunkSid SID of the trunk to handle calls to the new phone * number * @param string $voiceReceiveMode Incoming call type: fax or voice * @param string $bundleSid The SID of the Bundle resource associated with * number * @return CreateLocalOptions Options builder */ public static function create(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::NONE, string $voiceFallbackMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceUrl = Values::NONE, string $identitySid = Values::NONE, string $addressSid = Values::NONE, string $emergencyStatus = Values::NONE, string $emergencyAddressSid = Values::NONE, string $trunkSid = Values::NONE, string $voiceReceiveMode = Values::NONE, string $bundleSid = Values::NONE): CreateLocalOptions { return new CreateLocalOptions($apiVersion, $friendlyName, $smsApplicationSid, $smsFallbackMethod, $smsFallbackUrl, $smsMethod, $smsUrl, $statusCallback, $statusCallbackMethod, $voiceApplicationSid, $voiceCallerIdLookup, $voiceFallbackMethod, $voiceFallbackUrl, $voiceMethod, $voiceUrl, $identitySid, $addressSid, $emergencyStatus, $emergencyAddressSid, $trunkSid, $voiceReceiveMode, $bundleSid); } } class ReadLocalOptions extends Options { /** * @param bool $beta Whether to include new phone numbers * @param string $friendlyName A string that identifies the resources to read * @param string $phoneNumber The phone numbers of the resources to read * @param string $origin Include phone numbers based on their origin. By * default, phone numbers of all origin are included. */ public function __construct(bool $beta = Values::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 new phone numbers * @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 resources to read * @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 Include phone numbers based on their origin. 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 . ']'; } } class CreateLocalOptions extends Options { /** * @param string $apiVersion The API version to use for incoming calls made to * the new phone number * @param string $friendlyName A string to describe the new phone number * @param string $smsApplicationSid The SID of the application to handle SMS * messages * @param string $smsFallbackMethod The HTTP method we use to call * status_callback * @param string $smsFallbackUrl The URL we call when an error occurs while * executing TwiML * @param string $smsMethod The HTTP method to use with sms url * @param string $smsUrl The URL we should call when the new phone number * receives an incoming SMS message * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod HTTP method we should use to call * status_callback * @param string $voiceApplicationSid The SID of the application to handle the * new phone number * @param bool $voiceCallerIdLookup Whether to lookup the caller's name * @param string $voiceFallbackMethod The HTTP method used with * voice_fallback_url * @param string $voiceFallbackUrl The URL we will call when an error occurs in * TwiML * @param string $voiceMethod The HTTP method used with the voice_url * @param string $voiceUrl The URL we should call when the phone number * receives a call * @param string $identitySid The SID of the Identity resource to associate * with the new phone number * @param string $addressSid The SID of the Address resource associated with * the phone number * @param string $emergencyStatus Displays if emergency calling is enabled for * this number. * @param string $emergencyAddressSid The emergency address configuration to * use for emergency calling * @param string $trunkSid SID of the trunk to handle calls to the new phone * number * @param string $voiceReceiveMode Incoming call type: fax or voice * @param string $bundleSid The SID of the Bundle resource associated with * number */ public function __construct(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::NONE, string $voiceFallbackMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceUrl = Values::NONE, string $identitySid = Values::NONE, string $addressSid = Values::NONE, string $emergencyStatus = Values::NONE, string $emergencyAddressSid = Values::NONE, string $trunkSid = Values::NONE, string $voiceReceiveMode = Values::NONE, string $bundleSid = Values::NONE) { $this->options['apiVersion'] = $apiVersion; $this->options['friendlyName'] = $friendlyName; $this->options['smsApplicationSid'] = $smsApplicationSid; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsUrl'] = $smsUrl; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['voiceApplicationSid'] = $voiceApplicationSid; $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceUrl'] = $voiceUrl; $this->options['identitySid'] = $identitySid; $this->options['addressSid'] = $addressSid; $this->options['emergencyStatus'] = $emergencyStatus; $this->options['emergencyAddressSid'] = $emergencyAddressSid; $this->options['trunkSid'] = $trunkSid; $this->options['voiceReceiveMode'] = $voiceReceiveMode; $this->options['bundleSid'] = $bundleSid; } /** * The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. * * @param string $apiVersion The API version to use for incoming calls made to * the new phone number * @return $this Fluent Builder */ public function setApiVersion(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 string to describe 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 to handle SMS * messages * @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 we use to call * status_callback * @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 we call when an error occurs while * executing TwiML * @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 to use with sms url * @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 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 HTTP method we should use to call * status_callback * @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 to handle the * new phone number * @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 * @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 used with * voice_fallback_url * @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 we will call when an error occurs in * TwiML * @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 used with the voice_url * @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 we should call when the phone number * receives a call * @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 to associate * with the new phone number * @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 associated with * the phone number * @return $this Fluent Builder */ public function setAddressSid(string $addressSid): self { $this->options['addressSid'] = $addressSid; return $this; } /** * The parameter displays if emergency calling is enabled for this number. Active numbers may place emergency calls by dialing valid emergency numbers for the country. * * @param string $emergencyStatus Displays if emergency calling is enabled for * this number. * @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 emergency address configuration to * use for emergency calling * @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 SID of the trunk to handle calls to the new phone * number * @return $this Fluent Builder */ public function setTrunkSid(string $trunkSid): self { $this->options['trunkSid'] = $trunkSid; return $this; } /** * The configuration parameter for the new phone number to receive incoming voice calls or faxes. Can be: `fax` or `voice` and defaults to `voice`. * * @param string $voiceReceiveMode Incoming call type: fax or voice * @return $this Fluent Builder */ public function setVoiceReceiveMode(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 associated with * number * @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 . ']'; } } Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnPage.php 0000644 00000002677 15107452335 0017261 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class AssignedAddOnPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnInstance.php 0000644 00000011621 15107452335 0020136 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOn\AssignedAddOnExtensionList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $resourceSid * @property string $friendlyName * @property string $description * @property array $configuration * @property string $uniqueName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $uri * @property array $subresourceUris */ class AssignedAddOnInstance extends InstanceResource { protected $_extensions; /** * Initialize the AssignedAddOnInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $resourceSid The SID of the Phone Number that installed this * Add-on * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $accountSid, string $resourceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the AssignedAddOnInstance * * @return AssignedAddOnInstance Fetched AssignedAddOnInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AssignedAddOnInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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) . ']'; } } Api/V2010/Account/IncomingPhoneNumber/MobilePage.php 0000644 00000002312 15107452335 0016007 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MobilePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/IncomingPhoneNumber/TollFreeList.php 0000644 00000016137 15107452335 0016365 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class TollFreeList extends ListResource { /** * Construct the TollFreeList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/IncomingPhoneNumbers/TollFree.json'; } /** * Streams TollFreeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of TollFreeInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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); } /** * Create the TollFreeInstance * * @param string $phoneNumber The phone number to purchase in E.164 format * @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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); 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.TollFreeList]'; } } Api/V2010/Account/IncomingPhoneNumber/TollFreeOptions.php 0000644 00000055551 15107452335 0017110 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Options; use Twilio\Values; abstract class TollFreeOptions { /** * @param bool $beta Whether to include new phone numbers * @param string $friendlyName A string that identifies the resources to read * @param string $phoneNumber The phone numbers of the resources to read * @param string $origin Include phone numbers based on their origin. By * default, phone numbers of all origin are included. * @return ReadTollFreeOptions Options builder */ public static function read(bool $beta = Values::NONE, string $friendlyName = Values::NONE, string $phoneNumber = Values::NONE, string $origin = Values::NONE): ReadTollFreeOptions { return new ReadTollFreeOptions($beta, $friendlyName, $phoneNumber, $origin); } /** * @param string $apiVersion The API version to use for incoming calls made to * the new phone number * @param string $friendlyName A string to describe the new phone number * @param string $smsApplicationSid The SID of the application to handle SMS * messages * @param string $smsFallbackMethod HTTP method used with sms_fallback_url * @param string $smsFallbackUrl The URL we call when an error occurs while * executing TwiML * @param string $smsMethod The HTTP method to use with sms_url * @param string $smsUrl The URL we should call when the new phone number * receives an incoming SMS message * @param string $statusCallback The URL to send status information to your * application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @param string $voiceApplicationSid The SID of the application to handle the * new phone number * @param bool $voiceCallerIdLookup Whether to lookup the caller's name * @param string $voiceFallbackMethod The HTTP method used with * voice_fallback_url * @param string $voiceFallbackUrl The URL we will call when an error occurs in * TwiML * @param string $voiceMethod The HTTP method used with the voice_url * @param string $voiceUrl The URL we should call when the phone number * receives a call * @param string $identitySid The SID of the Identity resource to associate * with the new phone number * @param string $addressSid The SID of the Address resource associated with * the phone number * @param string $emergencyStatus Displays if emergency calling is enabled for * this number. * @param string $emergencyAddressSid The emergency address configuration to * use for emergency calling * @param string $trunkSid SID of the trunk to handle calls to the new phone * number * @param string $voiceReceiveMode Incoming call type: fax or voice * @param string $bundleSid The SID of the Bundle resource associated with * number * @return CreateTollFreeOptions Options builder */ public static function create(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::NONE, string $voiceFallbackMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceUrl = Values::NONE, string $identitySid = Values::NONE, string $addressSid = Values::NONE, string $emergencyStatus = Values::NONE, string $emergencyAddressSid = Values::NONE, string $trunkSid = Values::NONE, string $voiceReceiveMode = Values::NONE, string $bundleSid = Values::NONE): CreateTollFreeOptions { return new CreateTollFreeOptions($apiVersion, $friendlyName, $smsApplicationSid, $smsFallbackMethod, $smsFallbackUrl, $smsMethod, $smsUrl, $statusCallback, $statusCallbackMethod, $voiceApplicationSid, $voiceCallerIdLookup, $voiceFallbackMethod, $voiceFallbackUrl, $voiceMethod, $voiceUrl, $identitySid, $addressSid, $emergencyStatus, $emergencyAddressSid, $trunkSid, $voiceReceiveMode, $bundleSid); } } class ReadTollFreeOptions extends Options { /** * @param bool $beta Whether to include new phone numbers * @param string $friendlyName A string that identifies the resources to read * @param string $phoneNumber The phone numbers of the resources to read * @param string $origin Include phone numbers based on their origin. By * default, phone numbers of all origin are included. */ public function __construct(bool $beta = Values::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 new phone numbers * @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 resources to read * @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 Include phone numbers based on their origin. 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 . ']'; } } class CreateTollFreeOptions extends Options { /** * @param string $apiVersion The API version to use for incoming calls made to * the new phone number * @param string $friendlyName A string to describe the new phone number * @param string $smsApplicationSid The SID of the application to handle SMS * messages * @param string $smsFallbackMethod HTTP method used with sms_fallback_url * @param string $smsFallbackUrl The URL we call when an error occurs while * executing TwiML * @param string $smsMethod The HTTP method to use with sms_url * @param string $smsUrl The URL we should call when the new phone number * receives an incoming SMS message * @param string $statusCallback The URL to send status information to your * application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @param string $voiceApplicationSid The SID of the application to handle the * new phone number * @param bool $voiceCallerIdLookup Whether to lookup the caller's name * @param string $voiceFallbackMethod The HTTP method used with * voice_fallback_url * @param string $voiceFallbackUrl The URL we will call when an error occurs in * TwiML * @param string $voiceMethod The HTTP method used with the voice_url * @param string $voiceUrl The URL we should call when the phone number * receives a call * @param string $identitySid The SID of the Identity resource to associate * with the new phone number * @param string $addressSid The SID of the Address resource associated with * the phone number * @param string $emergencyStatus Displays if emergency calling is enabled for * this number. * @param string $emergencyAddressSid The emergency address configuration to * use for emergency calling * @param string $trunkSid SID of the trunk to handle calls to the new phone * number * @param string $voiceReceiveMode Incoming call type: fax or voice * @param string $bundleSid The SID of the Bundle resource associated with * number */ public function __construct(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::NONE, string $voiceFallbackMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceUrl = Values::NONE, string $identitySid = Values::NONE, string $addressSid = Values::NONE, string $emergencyStatus = Values::NONE, string $emergencyAddressSid = Values::NONE, string $trunkSid = Values::NONE, string $voiceReceiveMode = Values::NONE, string $bundleSid = Values::NONE) { $this->options['apiVersion'] = $apiVersion; $this->options['friendlyName'] = $friendlyName; $this->options['smsApplicationSid'] = $smsApplicationSid; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsUrl'] = $smsUrl; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['voiceApplicationSid'] = $voiceApplicationSid; $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceUrl'] = $voiceUrl; $this->options['identitySid'] = $identitySid; $this->options['addressSid'] = $addressSid; $this->options['emergencyStatus'] = $emergencyStatus; $this->options['emergencyAddressSid'] = $emergencyAddressSid; $this->options['trunkSid'] = $trunkSid; $this->options['voiceReceiveMode'] = $voiceReceiveMode; $this->options['bundleSid'] = $bundleSid; } /** * The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. * * @param string $apiVersion The API version to use for incoming calls made to * the new phone number * @return $this Fluent Builder */ public function setApiVersion(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 string to describe 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 `sms_*_url` values and use those of the application. * * @param string $smsApplicationSid The SID of the application to handle SMS * messages * @return $this Fluent Builder */ public function setSmsApplicationSid(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 HTTP method used with sms_fallback_url * @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 we call when an error occurs while * executing TwiML * @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 to use with sms_url * @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 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 * @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 to handle the * new phone number * @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 * @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 used with * voice_fallback_url * @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 we will call when an error occurs in * TwiML * @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 used with the voice_url * @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 we should call when the phone number * receives a call * @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 to associate * with the new phone number * @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 associated with * the phone number * @return $this Fluent Builder */ public function setAddressSid(string $addressSid): self { $this->options['addressSid'] = $addressSid; return $this; } /** * The parameter displays if emergency calling is enabled for this number. Active numbers may place emergency calls by dialing valid emergency numbers for the country. * * @param string $emergencyStatus Displays if emergency calling is enabled for * this number. * @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 emergency address configuration to * use for emergency calling * @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 SID of the trunk to handle calls to the new phone * number * @return $this Fluent Builder */ public function setTrunkSid(string $trunkSid): self { $this->options['trunkSid'] = $trunkSid; return $this; } /** * The configuration parameter for the new phone number to receive incoming voice calls or faxes. Can be: `fax` or `voice` and defaults to `voice`. * * @param string $voiceReceiveMode Incoming call type: fax or voice * @return $this Fluent Builder */ public function setVoiceReceiveMode(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 associated with * number * @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 . ']'; } } Api/V2010/Account/SipInstance.php 0000644 00000003112 15107452335 0012314 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; class SipInstance extends InstanceResource { /** * Initialize the SipInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); $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.SipInstance]'; } } Api/V2010/Account/NotificationContext.php 0000644 00000003471 15107452335 0014077 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class NotificationContext extends InstanceContext { /** * Initialize the NotificationContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Api/V2010/Account/QueueInstance.php 0000644 00000010737 15107452335 0012660 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Api\V2010\Account\Queue\MemberList; use Twilio\Values; use Twilio\Version; /** * @property \DateTime $dateUpdated * @property int $currentSize * @property string $friendlyName * @property string $uri * @property string $accountSid * @property int $averageWaitTime * @property string $sid * @property \DateTime $dateCreated * @property int $maxSize */ class QueueInstance extends InstanceResource { protected $_members; /** * Initialize the QueueInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created this resource * @param string $sid The unique string that identifies this resource */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * 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) . ']'; } } Api/V2010/Account/ShortCodeOptions.php 0000644 00000016240 15107452335 0013350 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class ShortCodeOptions { /** * @param string $friendlyName A string to describe this resource * @param string $apiVersion The API version to use to start a new TwiML session * @param string $smsUrl URL Twilio will request when receiving an SMS * @param string $smsMethod HTTP method to use when requesting the sms url * @param string $smsFallbackUrl URL Twilio will request if an error occurs in * executing TwiML * @param string $smsFallbackMethod HTTP method Twilio will use with * sms_fallback_url * @return UpdateShortCodeOptions Options builder */ public static function update(string $friendlyName = Values::NONE, string $apiVersion = Values::NONE, string $smsUrl = Values::NONE, string $smsMethod = Values::NONE, string $smsFallbackUrl = Values::NONE, string $smsFallbackMethod = Values::NONE): UpdateShortCodeOptions { return new UpdateShortCodeOptions($friendlyName, $apiVersion, $smsUrl, $smsMethod, $smsFallbackUrl, $smsFallbackMethod); } /** * @param string $friendlyName The string that identifies the ShortCode * resources to read * @param string $shortCode Filter by ShortCode * @return ReadShortCodeOptions Options builder */ public static function read(string $friendlyName = Values::NONE, string $shortCode = Values::NONE): ReadShortCodeOptions { return new ReadShortCodeOptions($friendlyName, $shortCode); } } class UpdateShortCodeOptions extends Options { /** * @param string $friendlyName A string to describe this resource * @param string $apiVersion The API version to use to start a new TwiML session * @param string $smsUrl URL Twilio will request when receiving an SMS * @param string $smsMethod HTTP method to use when requesting the sms url * @param string $smsFallbackUrl URL Twilio will request if an error occurs in * executing TwiML * @param string $smsFallbackMethod HTTP method Twilio will use with * sms_fallback_url */ public function __construct(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 string to describe this resource * @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 * @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 URL Twilio will request when receiving an SMS * @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 HTTP method to use when requesting the sms url * @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 URL Twilio will request if an error occurs in * executing TwiML * @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 HTTP method Twilio will use with * sms_fallback_url * @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 . ']'; } } class ReadShortCodeOptions extends Options { /** * @param string $friendlyName The string that identifies the ShortCode * resources to read * @param string $shortCode Filter by ShortCode */ public function __construct(string $friendlyName = Values::NONE, string $shortCode = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['shortCode'] = $shortCode; } /** * The string that identifies the ShortCode resources to read. * * @param string $friendlyName The string that identifies the ShortCode * resources to read * @return $this Fluent Builder */ public function setFriendlyName(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 Filter by ShortCode * @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 . ']'; } } Api/V2010/Account/ApplicationPage.php 0000644 00000002300 15107452335 0013132 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ApplicationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/AddressContext.php 0000644 00000011734 15107452335 0013037 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Api\V2010\Account\Address\DependentPhoneNumberList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property DependentPhoneNumberList $dependentPhoneNumbers */ class AddressContext extends InstanceContext { protected $_dependentPhoneNumbers; /** * Initialize the AddressContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that is responsible for * this address * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->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 { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the AddressInstance * * @return AddressInstance Fetched AddressInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AddressInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } Api/V2010/Account/AddressOptions.php 0000644 00000033152 15107452335 0013044 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class AddressOptions { /** * @param string $friendlyName A string to describe the new resource * @param bool $emergencyEnabled Whether to enable emergency calling on the new * address * @param bool $autoCorrectAddress Whether we should automatically correct the * address * @param string $streetSecondary The additional number and street address of * the address * @return CreateAddressOptions Options builder */ public static function create(string $friendlyName = Values::NONE, bool $emergencyEnabled = Values::NONE, bool $autoCorrectAddress = Values::NONE, string $streetSecondary = Values::NONE): CreateAddressOptions { return new CreateAddressOptions($friendlyName, $emergencyEnabled, $autoCorrectAddress, $streetSecondary); } /** * @param string $friendlyName A string to describe the resource * @param string $customerName The name to associate with the address * @param string $street The number and street address of the address * @param string $city The city of the address * @param string $region The state or region of the address * @param string $postalCode The postal code of the address * @param bool $emergencyEnabled Whether to enable emergency calling on the * address * @param bool $autoCorrectAddress Whether we should automatically correct the * address * @param string $streetSecondary The additional number and street address of * the address * @return UpdateAddressOptions Options builder */ public static function update(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::NONE, bool $autoCorrectAddress = Values::NONE, string $streetSecondary = Values::NONE): UpdateAddressOptions { return new UpdateAddressOptions($friendlyName, $customerName, $street, $city, $region, $postalCode, $emergencyEnabled, $autoCorrectAddress, $streetSecondary); } /** * @param string $customerName The `customer_name` of the Address resources to * read * @param string $friendlyName The string that identifies the Address resources * to read * @param string $isoCountry The ISO country code of the Address resources to * read * @return ReadAddressOptions Options builder */ public static function read(string $customerName = Values::NONE, string $friendlyName = Values::NONE, string $isoCountry = Values::NONE): ReadAddressOptions { return new ReadAddressOptions($customerName, $friendlyName, $isoCountry); } } class CreateAddressOptions extends Options { /** * @param string $friendlyName A string to describe the new resource * @param bool $emergencyEnabled Whether to enable emergency calling on the new * address * @param bool $autoCorrectAddress Whether we should automatically correct the * address * @param string $streetSecondary The additional number and street address of * the address */ public function __construct(string $friendlyName = Values::NONE, bool $emergencyEnabled = Values::NONE, bool $autoCorrectAddress = Values::NONE, string $streetSecondary = Values::NONE) { $this->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 string to describe the new resource * @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 * @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 * @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 UpdateAddressOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $customerName The name to associate with the address * @param string $street The number and street address of the address * @param string $city The city of the address * @param string $region The state or region of the address * @param string $postalCode The postal code of the address * @param bool $emergencyEnabled Whether to enable emergency calling on the * address * @param bool $autoCorrectAddress Whether we should automatically correct the * address * @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::NONE, bool $autoCorrectAddress = Values::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 string to describe the resource * @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 * @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 * @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 . ']'; } } 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 . ']'; } } Api/V2010/Account/IncomingPhoneNumberOptions.php 0000644 00000131773 15107452335 0015375 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class IncomingPhoneNumberOptions { /** * @param string $accountSid The SID of the Account that created the resource * to update * @param string $apiVersion The API version to use for incoming calls made to * the phone number * @param string $friendlyName A string to describe the resource * @param string $smsApplicationSid Unique string that identifies the * application * @param string $smsFallbackMethod HTTP method used with sms_fallback_url * @param string $smsFallbackUrl The URL we call when an error occurs while * executing TwiML * @param string $smsMethod The HTTP method to use with sms_url * @param string $smsUrl The URL we should call when the phone number receives * an incoming SMS message * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @param string $voiceApplicationSid The SID of the application to handle the * phone number * @param bool $voiceCallerIdLookup Whether to lookup the caller's name * @param string $voiceFallbackMethod The HTTP method used with fallback_url * @param string $voiceFallbackUrl The URL we will call when an error occurs in * TwiML * @param string $voiceMethod The HTTP method used with the voice_url * @param string $voiceUrl The URL we should call when the phone number * receives a call * @param string $emergencyStatus Displays if emergency calling is enabled for * this number. * @param string $emergencyAddressSid The emergency address configuration to * use for emergency calling * @param string $trunkSid SID of the trunk to handle phone calls to the phone * number * @param string $voiceReceiveMode Incoming call type: fax or voice * @param string $identitySid Unique string that identifies the identity * associated with number * @param string $addressSid The SID of the Address resource associated with * the phone number * @param string $bundleSid The SID of the Bundle resource associated with * number * @return UpdateIncomingPhoneNumberOptions Options builder */ public static function update(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::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): UpdateIncomingPhoneNumberOptions { return new UpdateIncomingPhoneNumberOptions($accountSid, $apiVersion, $friendlyName, $smsApplicationSid, $smsFallbackMethod, $smsFallbackUrl, $smsMethod, $smsUrl, $statusCallback, $statusCallbackMethod, $voiceApplicationSid, $voiceCallerIdLookup, $voiceFallbackMethod, $voiceFallbackUrl, $voiceMethod, $voiceUrl, $emergencyStatus, $emergencyAddressSid, $trunkSid, $voiceReceiveMode, $identitySid, $addressSid, $bundleSid); } /** * @param bool $beta Whether to include new phone numbers * @param string $friendlyName A string that identifies the IncomingPhoneNumber * resources to read * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber * resources to read * @param string $origin Include phone numbers based on their origin. By * default, phone numbers of all origin are included. * @return ReadIncomingPhoneNumberOptions Options builder */ public static function read(bool $beta = Values::NONE, string $friendlyName = Values::NONE, string $phoneNumber = Values::NONE, string $origin = Values::NONE): ReadIncomingPhoneNumberOptions { return new ReadIncomingPhoneNumberOptions($beta, $friendlyName, $phoneNumber, $origin); } /** * @param string $phoneNumber The phone number to purchase in E.164 format * @param string $areaCode The desired area code for the new phone number * @param string $apiVersion The API version to use for incoming calls made to * the new phone number * @param string $friendlyName A string to describe the new phone number * @param string $smsApplicationSid The SID of the application to handle SMS * messages * @param string $smsFallbackMethod HTTP method used with sms_fallback_url * @param string $smsFallbackUrl The URL we call when an error occurs while * executing TwiML * @param string $smsMethod The HTTP method to use with sms url * @param string $smsUrl The URL we should call when the new phone number * receives an incoming SMS message * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod HTTP method we should use to call * status_callback * @param string $voiceApplicationSid The SID of the application to handle the * new phone number * @param bool $voiceCallerIdLookup Whether to lookup the caller's name * @param string $voiceFallbackMethod The HTTP method used with * voice_fallback_url * @param string $voiceFallbackUrl The URL we will call when an error occurs in * TwiML * @param string $voiceMethod The HTTP method used with the voice_url * @param string $voiceUrl The URL we should call when the phone number * receives a call * @param string $emergencyStatus Displays if emergency calling is enabled for * this number. * @param string $emergencyAddressSid The emergency address configuration to * use for emergency calling * @param string $trunkSid SID of the trunk to handle calls to the new phone * number * @param string $identitySid The SID of the Identity resource to associate * with the new phone number * @param string $addressSid The SID of the Address resource associated with * the phone number * @param string $voiceReceiveMode Incoming call type: fax or voice * @param string $bundleSid The SID of the Bundle resource associated with * number * @return CreateIncomingPhoneNumberOptions Options builder */ public static function create(string $phoneNumber = Values::NONE, string $areaCode = 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::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 $identitySid = Values::NONE, string $addressSid = Values::NONE, string $voiceReceiveMode = Values::NONE, string $bundleSid = Values::NONE): CreateIncomingPhoneNumberOptions { return new CreateIncomingPhoneNumberOptions($phoneNumber, $areaCode, $apiVersion, $friendlyName, $smsApplicationSid, $smsFallbackMethod, $smsFallbackUrl, $smsMethod, $smsUrl, $statusCallback, $statusCallbackMethod, $voiceApplicationSid, $voiceCallerIdLookup, $voiceFallbackMethod, $voiceFallbackUrl, $voiceMethod, $voiceUrl, $emergencyStatus, $emergencyAddressSid, $trunkSid, $identitySid, $addressSid, $voiceReceiveMode, $bundleSid); } } class UpdateIncomingPhoneNumberOptions extends Options { /** * @param string $accountSid The SID of the Account that created the resource * to update * @param string $apiVersion The API version to use for incoming calls made to * the phone number * @param string $friendlyName A string to describe the resource * @param string $smsApplicationSid Unique string that identifies the * application * @param string $smsFallbackMethod HTTP method used with sms_fallback_url * @param string $smsFallbackUrl The URL we call when an error occurs while * executing TwiML * @param string $smsMethod The HTTP method to use with sms_url * @param string $smsUrl The URL we should call when the phone number receives * an incoming SMS message * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @param string $voiceApplicationSid The SID of the application to handle the * phone number * @param bool $voiceCallerIdLookup Whether to lookup the caller's name * @param string $voiceFallbackMethod The HTTP method used with fallback_url * @param string $voiceFallbackUrl The URL we will call when an error occurs in * TwiML * @param string $voiceMethod The HTTP method used with the voice_url * @param string $voiceUrl The URL we should call when the phone number * receives a call * @param string $emergencyStatus Displays if emergency calling is enabled for * this number. * @param string $emergencyAddressSid The emergency address configuration to * use for emergency calling * @param string $trunkSid SID of the trunk to handle phone calls to the phone * number * @param string $voiceReceiveMode Incoming call type: fax or voice * @param string $identitySid Unique string that identifies the identity * associated with number * @param string $addressSid The SID of the Address resource associated with * the phone number * @param string $bundleSid The SID of the Bundle resource associated with * number */ public function __construct(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::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 that created the resource * to update * @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 * @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 string to describe the resource * @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 Unique string that identifies 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 HTTP method used with sms_fallback_url * @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 we call when an error occurs while * executing TwiML * @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 to use with sms_url * @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 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 * @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 to handle the * phone number * @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 * @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 used with fallback_url * @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 we will call when an error occurs in * TwiML * @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 used with the voice_url * @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 we should call when the phone number * receives a call * @return $this Fluent Builder */ public function setVoiceUrl(string $voiceUrl): self { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * The parameter displays if emergency calling is enabled for this number. Active numbers may place emergency calls by dialing valid emergency numbers for the country. * * @param string $emergencyStatus Displays if emergency calling is enabled for * this number. * @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 emergency address configuration to * use for emergency calling * @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 SID of the trunk to handle phone calls to the phone * number * @return $this Fluent Builder */ public function setTrunkSid(string $trunkSid): self { $this->options['trunkSid'] = $trunkSid; return $this; } /** * The configuration parameter for the phone number to receive incoming voice calls or faxes. Can be: `fax` or `voice` and defaults to `voice`. * * @param string $voiceReceiveMode Incoming call type: fax or voice * @return $this Fluent Builder */ public function setVoiceReceiveMode(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 Unique string that identifies the identity * associated with number * @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 associated with * the phone number * @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 associated with * number * @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 . ']'; } } class ReadIncomingPhoneNumberOptions extends Options { /** * @param bool $beta Whether to include new phone numbers * @param string $friendlyName A string that identifies the IncomingPhoneNumber * resources to read * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber * resources to read * @param string $origin Include phone numbers based on their origin. By * default, phone numbers of all origin are included. */ public function __construct(bool $beta = Values::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 new phone numbers * @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 * @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 Include phone numbers based on their origin. 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 CreateIncomingPhoneNumberOptions extends Options { /** * @param string $phoneNumber The phone number to purchase in E.164 format * @param string $areaCode The desired area code for the new phone number * @param string $apiVersion The API version to use for incoming calls made to * the new phone number * @param string $friendlyName A string to describe the new phone number * @param string $smsApplicationSid The SID of the application to handle SMS * messages * @param string $smsFallbackMethod HTTP method used with sms_fallback_url * @param string $smsFallbackUrl The URL we call when an error occurs while * executing TwiML * @param string $smsMethod The HTTP method to use with sms url * @param string $smsUrl The URL we should call when the new phone number * receives an incoming SMS message * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod HTTP method we should use to call * status_callback * @param string $voiceApplicationSid The SID of the application to handle the * new phone number * @param bool $voiceCallerIdLookup Whether to lookup the caller's name * @param string $voiceFallbackMethod The HTTP method used with * voice_fallback_url * @param string $voiceFallbackUrl The URL we will call when an error occurs in * TwiML * @param string $voiceMethod The HTTP method used with the voice_url * @param string $voiceUrl The URL we should call when the phone number * receives a call * @param string $emergencyStatus Displays if emergency calling is enabled for * this number. * @param string $emergencyAddressSid The emergency address configuration to * use for emergency calling * @param string $trunkSid SID of the trunk to handle calls to the new phone * number * @param string $identitySid The SID of the Identity resource to associate * with the new phone number * @param string $addressSid The SID of the Address resource associated with * the phone number * @param string $voiceReceiveMode Incoming call type: fax or voice * @param string $bundleSid The SID of the Bundle resource associated with * number */ public function __construct(string $phoneNumber = Values::NONE, string $areaCode = 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::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 $identitySid = Values::NONE, string $addressSid = Values::NONE, string $voiceReceiveMode = Values::NONE, string $bundleSid = Values::NONE) { $this->options['phoneNumber'] = $phoneNumber; $this->options['areaCode'] = $areaCode; $this->options['apiVersion'] = $apiVersion; $this->options['friendlyName'] = $friendlyName; $this->options['smsApplicationSid'] = $smsApplicationSid; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsUrl'] = $smsUrl; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['voiceApplicationSid'] = $voiceApplicationSid; $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceUrl'] = $voiceUrl; $this->options['emergencyStatus'] = $emergencyStatus; $this->options['emergencyAddressSid'] = $emergencyAddressSid; $this->options['trunkSid'] = $trunkSid; $this->options['identitySid'] = $identitySid; $this->options['addressSid'] = $addressSid; $this->options['voiceReceiveMode'] = $voiceReceiveMode; $this->options['bundleSid'] = $bundleSid; } /** * The phone number to purchase specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234. * * @param string $phoneNumber The phone number to purchase in E.164 format * @return $this Fluent Builder */ public function setPhoneNumber(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 the new phone number * @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 * @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 string to describe 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 to handle SMS * messages * @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 HTTP method used with sms_fallback_url * @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 we call when an error occurs while * executing TwiML * @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 to use with sms url * @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 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 HTTP method we should use to call * status_callback * @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 to handle the * new phone number * @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 * @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 used with * voice_fallback_url * @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 we will call when an error occurs in * TwiML * @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 used with the voice_url * @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 we should call when the phone number * receives a call * @return $this Fluent Builder */ public function setVoiceUrl(string $voiceUrl): self { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * The parameter displays if emergency calling is enabled for this number. Active numbers may place emergency calls by dialing valid emergency numbers for the country. * * @param string $emergencyStatus Displays if emergency calling is enabled for * this number. * @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 emergency address configuration to * use for emergency calling * @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 SID of the trunk to handle calls to the new phone * number * @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 to associate * with the new phone number * @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 associated with * the phone number * @return $this Fluent Builder */ public function setAddressSid(string $addressSid): self { $this->options['addressSid'] = $addressSid; return $this; } /** * The configuration parameter for the new phone number to receive incoming voice calls or faxes. Can be: `fax` or `voice` and defaults to `voice`. * * @param string $voiceReceiveMode Incoming call type: fax or voice * @return $this Fluent Builder */ public function setVoiceReceiveMode(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 associated with * number * @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 . ']'; } } Api/V2010/Account/ShortCodeInstance.php 0000644 00000010607 15107452335 0013462 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $shortCode * @property string $sid * @property string $smsFallbackMethod * @property string $smsFallbackUrl * @property string $smsMethod * @property string $smsUrl * @property string $uri */ class ShortCodeInstance extends InstanceResource { /** * Initialize the ShortCodeInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created this resource * @param string $sid The unique string that identifies this resource */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Api/V2010/Account/AuthorizedConnectAppInstance.php 0000644 00000010315 15107452335 0015655 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $connectAppCompanyName * @property string $connectAppDescription * @property string $connectAppFriendlyName * @property string $connectAppHomepageUrl * @property string $connectAppSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string[] $permissions * @property string $uri */ class AuthorizedConnectAppInstance extends InstanceResource { /** * Initialize the AuthorizedConnectAppInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $connectAppSid The SID of the Connect App to fetch */ public function __construct(Version $version, array $payload, string $accountSid, string $connectAppSid = null) { parent::__construct($version); // Marshaled Properties $this->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'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'permissions' => Values::array_get($payload, 'permissions'), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = [ '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) . ']'; } } Api/V2010/Account/NewKeyList.php 0000644 00000003165 15107452335 0012142 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class NewKeyList extends ListResource { /** * Construct the NewKeyList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); 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]'; } } Api/V2010/Account/SipPage.php 0000644 00000002220 15107452335 0011423 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SipPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/ApplicationList.php 0000644 00000015536 15107452335 0013210 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ApplicationList extends ListResource { /** * Construct the ApplicationList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->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']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ApplicationInstance($this->version, $payload, $this->solution['accountSid']); } /** * Streams ApplicationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of ApplicationInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 unique string that identifies the resource */ 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]'; } } Api/V2010/Account/SigningKeyList.php 0000644 00000011432 15107452335 0013003 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class SigningKeyList extends ListResource { /** * Construct the SigningKeyList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. */ public function __construct(Version $version, string $accountSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SigningKeys.json'; } /** * Streams SigningKeyInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 The 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]'; } } Api/V2010/Account/Message/MediaInstance.php 0000644 00000007653 15107452335 0014202 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Message; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $contentType * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $parentSid * @property string $sid * @property string $uri */ class MediaInstance extends InstanceResource { /** * Initialize the MediaInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created this resource * @param string $messageSid The unique string that identifies the resource * @param string $sid The unique string that identifies this resource */ public function __construct(Version $version, array $payload, string $accountSid, string $messageSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Api/V2010/Account/Message/FeedbackPage.php 0000644 00000002427 15107452335 0013751 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Message; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class FeedbackPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Message/MediaOptions.php 0000644 00000010077 15107452335 0014063 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Message; use Twilio\Options; use Twilio\Values; abstract class MediaOptions { /** * @param string $dateCreatedBefore Only include media that was created on this * date * @param string $dateCreated Only include media that was created on this date * @param string $dateCreatedAfter Only include media that was created on this * date * @return ReadMediaOptions Options builder */ public static function read(string $dateCreatedBefore = Values::NONE, string $dateCreated = Values::NONE, string $dateCreatedAfter = Values::NONE): ReadMediaOptions { return new ReadMediaOptions($dateCreatedBefore, $dateCreated, $dateCreatedAfter); } } class ReadMediaOptions extends Options { /** * @param string $dateCreatedBefore Only include media that was created on this * date * @param string $dateCreated Only include media that was created on this date * @param string $dateCreatedAfter Only include media that was created on this * date */ public function __construct(string $dateCreatedBefore = Values::NONE, string $dateCreated = Values::NONE, string $dateCreatedAfter = Values::NONE) { $this->options['dateCreatedBefore'] = $dateCreatedBefore; $this->options['dateCreated'] = $dateCreated; $this->options['dateCreatedAfter'] = $dateCreatedAfter; } /** * Only include media that was created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read media that was created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read media that was created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read media that was created on or after midnight of this date. * * @param string $dateCreatedBefore Only include media that was created on this * date * @return $this Fluent Builder */ public function setDateCreatedBefore(string $dateCreatedBefore): self { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * Only include media that was created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read media that was created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read media that was created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read media that was created on or after midnight of this date. * * @param string $dateCreated Only include media that was created on this date * @return $this Fluent Builder */ public function setDateCreated(string $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * Only include media that was created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read media that was created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read media that was created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read media that was created on or after midnight of this date. * * @param string $dateCreatedAfter Only include media that was created on this * date * @return $this Fluent Builder */ public function setDateCreatedAfter(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 . ']'; } } Api/V2010/Account/Message/MediaContext.php 0000644 00000004443 15107452335 0014054 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Message; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class MediaContext extends InstanceContext { /** * Initialize the MediaContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the * resource(s) to fetch * @param string $messageSid The SID of the Message resource that this Media * resource belongs to * @param string $sid The unique string that identifies this resource */ public function __construct(Version $version, $accountSid, $messageSid, $sid) { parent::__construct($version); // Path Solution $this->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 { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the MediaInstance * * @return MediaInstance Fetched MediaInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MediaInstance { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Api/V2010/Account/Message/FeedbackInstance.php 0000644 00000004736 15107452335 0014646 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Message; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $messageSid * @property string $outcome * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $uri */ class FeedbackInstance extends InstanceResource { /** * Initialize the FeedbackInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $messageSid The SID of the Message resource for which the * feedback was provided */ public function __construct(Version $version, array $payload, string $accountSid, string $messageSid) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Api/V2010/Account/Message/FeedbackList.php 0000644 00000003625 15107452335 0014011 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Message; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class FeedbackList extends ListResource { /** * Construct the FeedbackList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @param string $messageSid The SID of the Message resource for which the * feedback was provided */ public function __construct(Version $version, string $accountSid, string $messageSid) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new FeedbackInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['messageSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.FeedbackList]'; } } Api/V2010/Account/Message/FeedbackOptions.php 0000644 00000003205 15107452336 0014524 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Message; use Twilio\Options; use Twilio\Values; abstract class FeedbackOptions { /** * @param string $outcome Whether the feedback has arrived * @return CreateFeedbackOptions Options builder */ public static function create(string $outcome = Values::NONE): CreateFeedbackOptions { return new CreateFeedbackOptions($outcome); } } class CreateFeedbackOptions extends Options { /** * @param string $outcome Whether the feedback has arrived */ public function __construct(string $outcome = Values::NONE) { $this->options['outcome'] = $outcome; } /** * Whether the feedback has arrived. Can be: `unconfirmed` or `confirmed`. If `provide_feedback`=`true` in [the initial HTTP POST](https://www.twilio.com/docs/sms/api/message-resource#create-a-message-resource), the initial value of this property is `unconfirmed`. After the message arrives, update the value to `confirmed`. * * @param string $outcome Whether the feedback has arrived * @return $this Fluent Builder */ public function setOutcome(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 . ']'; } } Api/V2010/Account/Message/MediaPage.php 0000644 00000002405 15107452336 0013301 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Message; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MediaPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Api/V2010/Account/Message/MediaList.php 0000644 00000013075 15107452336 0013345 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Message; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class MediaList extends ListResource { /** * Construct the MediaList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created this resource * @param string $messageSid The unique string that identifies the resource */ public function __construct(Version $version, string $accountSid, string $messageSid) { parent::__construct($version); // Path Solution $this->solution = ['accountSid' => $accountSid, 'messageSid' => $messageSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Messages/' . \rawurlencode($messageSid) . '/Media.json'; } /** * Streams MediaInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of MediaInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 string that identifies this 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]'; } } Api/V2010/Account/CallInstance.php 0000644 00000020153 15107452336 0012441 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Api\V2010\Account\Call\EventList; use Twilio\Rest\Api\V2010\Account\Call\FeedbackList; use Twilio\Rest\Api\V2010\Account\Call\NotificationList; use Twilio\Rest\Api\V2010\Account\Call\PaymentList; use Twilio\Rest\Api\V2010\Account\Call\RecordingList; use Twilio\Rest\Api\V2010\Account\Call\SiprecList; use Twilio\Rest\Api\V2010\Account\Call\StreamList; use Twilio\Rest\Api\V2010\Account\Call\UserDefinedMessageList; use Twilio\Rest\Api\V2010\Account\Call\UserDefinedMessageSubscriptionList; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $parentCallSid * @property string $accountSid * @property string $to * @property string $toFormatted * @property string $from * @property string $fromFormatted * @property string $phoneNumberSid * @property string $status * @property \DateTime $startTime * @property \DateTime $endTime * @property string $duration * @property string $price * @property string $priceUnit * @property string $direction * @property string $answeredBy * @property string $apiVersion * @property string $forwardedFrom * @property string $groupSid * @property string $callerName * @property string $queueTime * @property string $trunkSid * @property string $uri * @property array $subresourceUris */ class CallInstance extends InstanceResource { protected $_recordings; protected $_notifications; protected $_feedback; protected $_events; protected $_payments; protected $_siprec; protected $_streams; protected $_userDefinedMessageSubscriptions; protected $_userDefinedMessages; /** * Initialize the CallInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created this resource * @param string $sid The SID of the Call resource to fetch */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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 recordings */ protected function getRecordings(): RecordingList { return $this->proxy()->recordings; } /** * Access the notifications */ protected function getNotifications(): NotificationList { return $this->proxy()->notifications; } /** * Access the feedback */ protected function getFeedback(): FeedbackList { return $this->proxy()->feedback; } /** * Access the events */ protected function getEvents(): EventList { return $this->proxy()->events; } /** * Access the payments */ protected function getPayments(): PaymentList { return $this->proxy()->payments; } /** * Access the siprec */ protected function getSiprec(): SiprecList { return $this->proxy()->siprec; } /** * Access the streams */ protected function getStreams(): StreamList { return $this->proxy()->streams; } /** * Access the userDefinedMessageSubscriptions */ protected function getUserDefinedMessageSubscriptions(): UserDefinedMessageSubscriptionList { return $this->proxy()->userDefinedMessageSubscriptions; } /** * Access the userDefinedMessages */ protected function getUserDefinedMessages(): UserDefinedMessageList { return $this->proxy()->userDefinedMessages; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Api/V2010/AccountInstance.php 0000644 00000022603 15107452336 0011570 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Api\V2010\Account\AddressList; use Twilio\Rest\Api\V2010\Account\ApplicationList; use Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList; use Twilio\Rest\Api\V2010\Account\BalanceList; use Twilio\Rest\Api\V2010\Account\CallList; use Twilio\Rest\Api\V2010\Account\ConferenceList; use Twilio\Rest\Api\V2010\Account\ConnectAppList; use Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList; use Twilio\Rest\Api\V2010\Account\KeyList; use Twilio\Rest\Api\V2010\Account\MessageList; use Twilio\Rest\Api\V2010\Account\NewKeyList; use Twilio\Rest\Api\V2010\Account\NewSigningKeyList; use Twilio\Rest\Api\V2010\Account\NotificationList; use Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList; use Twilio\Rest\Api\V2010\Account\QueueList; use Twilio\Rest\Api\V2010\Account\RecordingList; use Twilio\Rest\Api\V2010\Account\ShortCodeList; use Twilio\Rest\Api\V2010\Account\SigningKeyList; use Twilio\Rest\Api\V2010\Account\SipList; use Twilio\Rest\Api\V2010\Account\TokenList; use Twilio\Rest\Api\V2010\Account\TranscriptionList; use Twilio\Rest\Api\V2010\Account\UsageList; use Twilio\Rest\Api\V2010\Account\ValidationRequestList; use Twilio\Values; use Twilio\Version; /** * @property string $authToken * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $ownerAccountSid * @property string $sid * @property string $status * @property array $subresourceUris * @property string $type * @property string $uri */ class AccountInstance extends InstanceResource { protected $_addresses; protected $_applications; protected $_authorizedConnectApps; protected $_availablePhoneNumbers; protected $_balance; protected $_calls; protected $_conferences; protected $_connectApps; protected $_incomingPhoneNumbers; protected $_keys; protected $_messages; protected $_newKeys; protected $_newSigningKeys; protected $_notifications; protected $_outgoingCallerIds; protected $_queues; protected $_recordings; protected $_signingKeys; protected $_sip; protected $_shortCodes; protected $_tokens; protected $_transcriptions; protected $_usage; protected $_validationRequests; /** * Initialize the AccountInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid Fetch by unique Account Sid */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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 addresses */ protected function getAddresses(): AddressList { return $this->proxy()->addresses; } /** * Access the applications */ protected function getApplications(): ApplicationList { return $this->proxy()->applications; } /** * Access the authorizedConnectApps */ protected function getAuthorizedConnectApps(): AuthorizedConnectAppList { return $this->proxy()->authorizedConnectApps; } /** * Access the availablePhoneNumbers */ protected function getAvailablePhoneNumbers(): AvailablePhoneNumberCountryList { return $this->proxy()->availablePhoneNumbers; } /** * Access the balance */ protected function getBalance(): BalanceList { return $this->proxy()->balance; } /** * Access the calls */ protected function getCalls(): CallList { return $this->proxy()->calls; } /** * Access the conferences */ protected function getConferences(): ConferenceList { return $this->proxy()->conferences; } /** * Access the connectApps */ protected function getConnectApps(): ConnectAppList { return $this->proxy()->connectApps; } /** * Access the incomingPhoneNumbers */ protected function getIncomingPhoneNumbers(): IncomingPhoneNumberList { return $this->proxy()->incomingPhoneNumbers; } /** * Access the keys */ protected function getKeys(): KeyList { return $this->proxy()->keys; } /** * Access the messages */ protected function getMessages(): MessageList { return $this->proxy()->messages; } /** * Access the newKeys */ protected function getNewKeys(): NewKeyList { return $this->proxy()->newKeys; } /** * Access the newSigningKeys */ protected function getNewSigningKeys(): NewSigningKeyList { return $this->proxy()->newSigningKeys; } /** * Access the notifications */ protected function getNotifications(): NotificationList { return $this->proxy()->notifications; } /** * Access the outgoingCallerIds */ protected function getOutgoingCallerIds(): OutgoingCallerIdList { return $this->proxy()->outgoingCallerIds; } /** * Access the queues */ protected function getQueues(): QueueList { return $this->proxy()->queues; } /** * Access the recordings */ protected function getRecordings(): RecordingList { return $this->proxy()->recordings; } /** * Access the signingKeys */ protected function getSigningKeys(): SigningKeyList { return $this->proxy()->signingKeys; } /** * Access the sip */ protected function getSip(): SipList { return $this->proxy()->sip; } /** * Access the shortCodes */ protected function getShortCodes(): ShortCodeList { return $this->proxy()->shortCodes; } /** * Access the tokens */ protected function getTokens(): TokenList { return $this->proxy()->tokens; } /** * Access the transcriptions */ protected function getTranscriptions(): TranscriptionList { return $this->proxy()->transcriptions; } /** * Access the usage */ protected function getUsage(): UsageList { return $this->proxy()->usage; } /** * Access the validationRequests */ protected function getValidationRequests(): ValidationRequestList { return $this->proxy()->validationRequests; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Supersim.php 0000644 00000013625 15107452336 0007101 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Supersim\V1; /** * @property \Twilio\Rest\Supersim\V1 $v1 * @property \Twilio\Rest\Supersim\V1\EsimProfileList $esimProfiles * @property \Twilio\Rest\Supersim\V1\FleetList $fleets * @property \Twilio\Rest\Supersim\V1\IpCommandList $ipCommands * @property \Twilio\Rest\Supersim\V1\NetworkList $networks * @property \Twilio\Rest\Supersim\V1\NetworkAccessProfileList $networkAccessProfiles * @property \Twilio\Rest\Supersim\V1\SettingsUpdateList $settingsUpdates * @property \Twilio\Rest\Supersim\V1\SimList $sims * @property \Twilio\Rest\Supersim\V1\SmsCommandList $smsCommands * @property \Twilio\Rest\Supersim\V1\UsageRecordList $usageRecords * @method \Twilio\Rest\Supersim\V1\EsimProfileContext esimProfiles(string $sid) * @method \Twilio\Rest\Supersim\V1\FleetContext fleets(string $sid) * @method \Twilio\Rest\Supersim\V1\IpCommandContext ipCommands(string $sid) * @method \Twilio\Rest\Supersim\V1\NetworkContext networks(string $sid) * @method \Twilio\Rest\Supersim\V1\NetworkAccessProfileContext networkAccessProfiles(string $sid) * @method \Twilio\Rest\Supersim\V1\SimContext sims(string $sid) * @method \Twilio\Rest\Supersim\V1\SmsCommandContext smsCommands(string $sid) */ class Supersim extends Domain { protected $_v1; /** * Construct the Supersim Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->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); } protected function getEsimProfiles(): \Twilio\Rest\Supersim\V1\EsimProfileList { return $this->v1->esimProfiles; } /** * @param string $sid The SID of the eSIM Profile resource to fetch */ protected function contextEsimProfiles(string $sid): \Twilio\Rest\Supersim\V1\EsimProfileContext { return $this->v1->esimProfiles($sid); } protected function getFleets(): \Twilio\Rest\Supersim\V1\FleetList { return $this->v1->fleets; } /** * @param string $sid The SID that identifies the resource to fetch */ protected function contextFleets(string $sid): \Twilio\Rest\Supersim\V1\FleetContext { return $this->v1->fleets($sid); } protected function getIpCommands(): \Twilio\Rest\Supersim\V1\IpCommandList { return $this->v1->ipCommands; } /** * @param string $sid The SID that identifies the resource to fetch */ protected function contextIpCommands(string $sid): \Twilio\Rest\Supersim\V1\IpCommandContext { return $this->v1->ipCommands($sid); } protected function getNetworks(): \Twilio\Rest\Supersim\V1\NetworkList { return $this->v1->networks; } /** * @param string $sid The SID of the Network resource to fetch */ protected function contextNetworks(string $sid): \Twilio\Rest\Supersim\V1\NetworkContext { return $this->v1->networks($sid); } protected function getNetworkAccessProfiles(): \Twilio\Rest\Supersim\V1\NetworkAccessProfileList { return $this->v1->networkAccessProfiles; } /** * @param string $sid The SID that identifies the resource to fetch */ protected function contextNetworkAccessProfiles(string $sid): \Twilio\Rest\Supersim\V1\NetworkAccessProfileContext { return $this->v1->networkAccessProfiles($sid); } protected function getSettingsUpdates(): \Twilio\Rest\Supersim\V1\SettingsUpdateList { return $this->v1->settingsUpdates; } protected function getSims(): \Twilio\Rest\Supersim\V1\SimList { return $this->v1->sims; } /** * @param string $sid The SID that identifies the resource to fetch */ protected function contextSims(string $sid): \Twilio\Rest\Supersim\V1\SimContext { return $this->v1->sims($sid); } protected function getSmsCommands(): \Twilio\Rest\Supersim\V1\SmsCommandList { return $this->v1->smsCommands; } /** * @param string $sid The SID that identifies the resource to fetch */ protected function contextSmsCommands(string $sid): \Twilio\Rest\Supersim\V1\SmsCommandContext { return $this->v1->smsCommands($sid); } protected function getUsageRecords(): \Twilio\Rest\Supersim\V1\UsageRecordList { return $this->v1->usageRecords; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim]'; } } Preview.php 0000644 00000023214 15107452336 0006706 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Preview\DeployedDevices as PreviewDeployedDevices; use Twilio\Rest\Preview\HostedNumbers as PreviewHostedNumbers; use Twilio\Rest\Preview\Marketplace as PreviewMarketplace; use Twilio\Rest\Preview\Sync as PreviewSync; use Twilio\Rest\Preview\Understand as PreviewUnderstand; use Twilio\Rest\Preview\Wireless as PreviewWireless; /** * @property \Twilio\Rest\Preview\DeployedDevices $deployedDevices * @property \Twilio\Rest\Preview\HostedNumbers $hostedNumbers * @property \Twilio\Rest\Preview\Marketplace $marketplace * @property \Twilio\Rest\Preview\Sync $sync * @property \Twilio\Rest\Preview\Understand $understand * @property \Twilio\Rest\Preview\Wireless $wireless * @property \Twilio\Rest\Preview\DeployedDevices\FleetList $fleets * @property \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocumentList $authorizationDocuments * @property \Twilio\Rest\Preview\HostedNumbers\HostedNumberOrderList $hostedNumberOrders * @property \Twilio\Rest\Preview\Marketplace\AvailableAddOnList $availableAddOns * @property \Twilio\Rest\Preview\Marketplace\InstalledAddOnList $installedAddOns * @property \Twilio\Rest\Preview\Sync\ServiceList $services * @property \Twilio\Rest\Preview\Understand\AssistantList $assistants * @property \Twilio\Rest\Preview\Wireless\CommandList $commands * @property \Twilio\Rest\Preview\Wireless\RatePlanList $ratePlans * @property \Twilio\Rest\Preview\Wireless\SimList $sims * @method \Twilio\Rest\Preview\DeployedDevices\FleetContext fleets(string $sid) * @method \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocumentContext authorizationDocuments(string $sid) * @method \Twilio\Rest\Preview\HostedNumbers\HostedNumberOrderContext hostedNumberOrders(string $sid) * @method \Twilio\Rest\Preview\Marketplace\AvailableAddOnContext availableAddOns(string $sid) * @method \Twilio\Rest\Preview\Marketplace\InstalledAddOnContext installedAddOns(string $sid) * @method \Twilio\Rest\Preview\Sync\ServiceContext services(string $sid) * @method \Twilio\Rest\Preview\Understand\AssistantContext assistants(string $sid) * @method \Twilio\Rest\Preview\Wireless\CommandContext commands(string $sid) * @method \Twilio\Rest\Preview\Wireless\RatePlanContext ratePlans(string $sid) * @method \Twilio\Rest\Preview\Wireless\SimContext sims(string $sid) */ class Preview extends Domain { protected $_deployedDevices; protected $_hostedNumbers; protected $_marketplace; protected $_sync; protected $_understand; protected $_wireless; /** * Construct the Preview Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://preview.twilio.com'; } /** * @return PreviewDeployedDevices Version deployedDevices of preview */ protected function getDeployedDevices(): PreviewDeployedDevices { if (!$this->_deployedDevices) { $this->_deployedDevices = new PreviewDeployedDevices($this); } return $this->_deployedDevices; } /** * @return PreviewHostedNumbers Version hostedNumbers of preview */ protected function getHostedNumbers(): PreviewHostedNumbers { if (!$this->_hostedNumbers) { $this->_hostedNumbers = new PreviewHostedNumbers($this); } return $this->_hostedNumbers; } /** * @return PreviewMarketplace Version marketplace of preview */ protected function getMarketplace(): PreviewMarketplace { if (!$this->_marketplace) { $this->_marketplace = new PreviewMarketplace($this); } return $this->_marketplace; } /** * @return PreviewSync Version sync of preview */ protected function getSync(): PreviewSync { if (!$this->_sync) { $this->_sync = new PreviewSync($this); } return $this->_sync; } /** * @return PreviewUnderstand Version understand of preview */ protected function getUnderstand(): PreviewUnderstand { if (!$this->_understand) { $this->_understand = new PreviewUnderstand($this); } return $this->_understand; } /** * @return PreviewWireless Version wireless of preview */ protected function getWireless(): PreviewWireless { if (!$this->_wireless) { $this->_wireless = new PreviewWireless($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); } protected function getFleets(): \Twilio\Rest\Preview\DeployedDevices\FleetList { return $this->deployedDevices->fleets; } /** * @param string $sid A string that uniquely identifies the Fleet. */ protected function contextFleets(string $sid): \Twilio\Rest\Preview\DeployedDevices\FleetContext { return $this->deployedDevices->fleets($sid); } protected function getAuthorizationDocuments(): \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocumentList { return $this->hostedNumbers->authorizationDocuments; } /** * @param string $sid AuthorizationDocument sid. */ protected function contextAuthorizationDocuments(string $sid): \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocumentContext { return $this->hostedNumbers->authorizationDocuments($sid); } protected function getHostedNumberOrders(): \Twilio\Rest\Preview\HostedNumbers\HostedNumberOrderList { return $this->hostedNumbers->hostedNumberOrders; } /** * @param string $sid HostedNumberOrder sid. */ protected function contextHostedNumberOrders(string $sid): \Twilio\Rest\Preview\HostedNumbers\HostedNumberOrderContext { return $this->hostedNumbers->hostedNumberOrders($sid); } protected function getAvailableAddOns(): \Twilio\Rest\Preview\Marketplace\AvailableAddOnList { return $this->marketplace->availableAddOns; } /** * @param string $sid The SID of the AvailableAddOn resource to fetch */ protected function contextAvailableAddOns(string $sid): \Twilio\Rest\Preview\Marketplace\AvailableAddOnContext { return $this->marketplace->availableAddOns($sid); } protected function getInstalledAddOns(): \Twilio\Rest\Preview\Marketplace\InstalledAddOnList { return $this->marketplace->installedAddOns; } /** * @param string $sid The SID of the InstalledAddOn resource to fetch */ protected function contextInstalledAddOns(string $sid): \Twilio\Rest\Preview\Marketplace\InstalledAddOnContext { return $this->marketplace->installedAddOns($sid); } protected function getServices(): \Twilio\Rest\Preview\Sync\ServiceList { return $this->sync->services; } /** * @param string $sid The sid */ protected function contextServices(string $sid): \Twilio\Rest\Preview\Sync\ServiceContext { return $this->sync->services($sid); } protected function getAssistants(): \Twilio\Rest\Preview\Understand\AssistantList { return $this->understand->assistants; } /** * @param string $sid A 34 character string that uniquely identifies this * resource. */ protected function contextAssistants(string $sid): \Twilio\Rest\Preview\Understand\AssistantContext { return $this->understand->assistants($sid); } protected function getCommands(): \Twilio\Rest\Preview\Wireless\CommandList { return $this->wireless->commands; } /** * @param string $sid The sid */ protected function contextCommands(string $sid): \Twilio\Rest\Preview\Wireless\CommandContext { return $this->wireless->commands($sid); } protected function getRatePlans(): \Twilio\Rest\Preview\Wireless\RatePlanList { return $this->wireless->ratePlans; } /** * @param string $sid The sid */ protected function contextRatePlans(string $sid): \Twilio\Rest\Preview\Wireless\RatePlanContext { return $this->wireless->ratePlans($sid); } protected function getSims(): \Twilio\Rest\Preview\Wireless\SimList { return $this->wireless->sims; } /** * @param string $sid The sid */ protected function contextSims(string $sid): \Twilio\Rest\Preview\Wireless\SimContext { return $this->wireless->sims($sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview]'; } } Verify.php 0000644 00000011307 15107452336 0006531 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Verify\V2; /** * @property \Twilio\Rest\Verify\V2 $v2 * @property \Twilio\Rest\Verify\V2\FormList $forms * @property \Twilio\Rest\Verify\V2\SafelistList $safelist * @property \Twilio\Rest\Verify\V2\ServiceList $services * @property \Twilio\Rest\Verify\V2\VerificationAttemptList $verificationAttempts * @property \Twilio\Rest\Verify\V2\VerificationAttemptsSummaryList $verificationAttemptsSummary * @property \Twilio\Rest\Verify\V2\TemplateList $templates * @method \Twilio\Rest\Verify\V2\FormContext forms(string $formType) * @method \Twilio\Rest\Verify\V2\SafelistContext safelist(string $phoneNumber) * @method \Twilio\Rest\Verify\V2\ServiceContext services(string $sid) * @method \Twilio\Rest\Verify\V2\VerificationAttemptContext verificationAttempts(string $sid) * @method \Twilio\Rest\Verify\V2\VerificationAttemptsSummaryContext verificationAttemptsSummary() */ class Verify extends Domain { protected $_v2; /** * Construct the Verify Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->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); } protected function getForms(): \Twilio\Rest\Verify\V2\FormList { return $this->v2->forms; } /** * @param string $formType The Type of this Form */ protected function contextForms(string $formType): \Twilio\Rest\Verify\V2\FormContext { return $this->v2->forms($formType); } protected function getSafelist(): \Twilio\Rest\Verify\V2\SafelistList { return $this->v2->safelist; } /** * @param string $phoneNumber The phone number to be fetched from SafeList. */ protected function contextSafelist(string $phoneNumber): \Twilio\Rest\Verify\V2\SafelistContext { return $this->v2->safelist($phoneNumber); } protected function getServices(): \Twilio\Rest\Verify\V2\ServiceList { return $this->v2->services; } /** * @param string $sid The unique string that identifies the resource */ protected function contextServices(string $sid): \Twilio\Rest\Verify\V2\ServiceContext { return $this->v2->services($sid); } protected function getVerificationAttempts(): \Twilio\Rest\Verify\V2\VerificationAttemptList { return $this->v2->verificationAttempts; } /** * @param string $sid Verification Attempt Sid. */ protected function contextVerificationAttempts(string $sid): \Twilio\Rest\Verify\V2\VerificationAttemptContext { return $this->v2->verificationAttempts($sid); } protected function getVerificationAttemptsSummary(): \Twilio\Rest\Verify\V2\VerificationAttemptsSummaryList { return $this->v2->verificationAttemptsSummary; } protected function contextVerificationAttemptsSummary(): \Twilio\Rest\Verify\V2\VerificationAttemptsSummaryContext { return $this->v2->verificationAttemptsSummary(); } protected function getTemplates(): \Twilio\Rest\Verify\V2\TemplateList { return $this->v2->templates; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify]'; } } Conversations/V1/ConversationContext.php 0000644 00000013623 15107452336 0014432 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Conversations\V1\Conversation\MessageList; use Twilio\Rest\Conversations\V1\Conversation\ParticipantList; use Twilio\Rest\Conversations\V1\Conversation\WebhookList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property ParticipantList $participants * @property MessageList $messages * @property WebhookList $webhooks * @method \Twilio\Rest\Conversations\V1\Conversation\ParticipantContext participants(string $sid) * @method \Twilio\Rest\Conversations\V1\Conversation\MessageContext messages(string $sid) * @method \Twilio\Rest\Conversations\V1\Conversation\WebhookContext webhooks(string $sid) */ class ConversationContext extends InstanceContext { protected $_participants; protected $_messages; protected $_webhooks; /** * Initialize the ConversationContext * * @param Version $version Version that contains the resource * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Conversations/' . \rawurlencode($sid) . ''; } /** * Update the ConversationInstance * * @param array|Options $options Optional Arguments * @return ConversationInstance Updated ConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(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'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled'], ]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new ConversationInstance($this->version, $payload, $this->solution['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(['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 { $payload = $this->version->fetch('GET', $this->uri); 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 messages */ protected function getMessages(): MessageList { if (!$this->_messages) { $this->_messages = new MessageList($this->version, $this->solution['sid']); } return $this->_messages; } /** * Access the webhooks */ protected function getWebhooks(): WebhookList { if (!$this->_webhooks) { $this->_webhooks = new WebhookList($this->version, $this->solution['sid']); } return $this->_webhooks; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return 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) . ']'; } } Conversations/V1/UserInstance.php 0000644 00000011375 15107452336 0013020 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Conversations\V1\User\UserConversationList; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $chatServiceSid * @property string $roleSid * @property string $identity * @property string $friendlyName * @property string $attributes * @property bool $isOnline * @property bool $isNotifiable * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class UserInstance extends InstanceResource { protected $_userConversations; /** * Initialize the UserInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the User resource to fetch */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * 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) . ']'; } } Conversations/V1/CredentialPage.php 0000644 00000002240 15107452336 0013253 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CredentialPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Conversations/V1/CredentialOptions.php 0000644 00000030551 15107452336 0014040 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Options; use Twilio\Values; abstract class CredentialOptions { /** * @param string $friendlyName A string to describe the resource * @param string $certificate [APN only] The URL encoded representation of the * certificate. * @param string $privateKey [APN only] The URL encoded representation of the * private key. * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs. * @param string $apiKey [GCM only] The API key for the project that was * obtained from the Google Developer console for your * GCM Service application credential. * @param string $secret [FCM only] The Server key of your project from * Firebase console. * @return CreateCredentialOptions Options builder */ public static function create(string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::NONE, string $apiKey = Values::NONE, string $secret = Values::NONE): CreateCredentialOptions { return new CreateCredentialOptions($friendlyName, $certificate, $privateKey, $sandbox, $apiKey, $secret); } /** * @param string $type The type of push-notification service the credential is * for. * @param string $friendlyName A string to describe the resource * @param string $certificate [APN only] The URL encoded representation of the * certificate. * @param string $privateKey [APN only] The URL encoded representation of the * private key. * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs. * @param string $apiKey [GCM only] The API key for the project that was * obtained from the Google Developer console for your * GCM Service application credential. * @param string $secret [FCM only] The Server key of your project from * Firebase console. * @return UpdateCredentialOptions Options builder */ public static function update(string $type = Values::NONE, string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::NONE, string $apiKey = Values::NONE, string $secret = Values::NONE): UpdateCredentialOptions { return new UpdateCredentialOptions($type, $friendlyName, $certificate, $privateKey, $sandbox, $apiKey, $secret); } } class CreateCredentialOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $certificate [APN only] The URL encoded representation of the * certificate. * @param string $privateKey [APN only] The URL encoded representation of the * private key. * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs. * @param string $apiKey [GCM only] The API key for the project that was * obtained from the Google Developer console for your * GCM Service application credential. * @param string $secret [FCM only] The Server key of your project from * Firebase console. */ public function __construct(string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::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 new resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName(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. * @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. * @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. * @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 * Firebase console. * @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 The type of push-notification service the credential is * for. * @param string $friendlyName A string to describe the resource * @param string $certificate [APN only] The URL encoded representation of the * certificate. * @param string $privateKey [APN only] The URL encoded representation of the * private key. * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs. * @param string $apiKey [GCM only] The API key for the project that was * obtained from the Google Developer console for your * GCM Service application credential. * @param string $secret [FCM only] The Server key of your project from * Firebase console. */ public function __construct(string $type = Values::NONE, string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::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; } /** * The type of push-notification service the credential is for. Can be: `fcm`, `gcm`, or `apn`. * * @param string $type The type of push-notification service the credential is * for. * @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 string to describe the resource * @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. * @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. * @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. * @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 * Firebase console. * @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 . ']'; } } Conversations/V1/ParticipantConversationPage.php 0000644 00000002356 15107452336 0016062 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ParticipantConversationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Conversations/V1/UserOptions.php 0000644 00000022160 15107452336 0012701 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Options; use Twilio\Values; abstract class UserOptions { /** * @param string $friendlyName The string that you assigned to describe the * resource * @param string $attributes The JSON Object string that stores * application-specific data * @param string $roleSid The SID of a service-level Role to assign to the user * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return CreateUserOptions Options builder */ public static function create(string $friendlyName = Values::NONE, string $attributes = Values::NONE, string $roleSid = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE): CreateUserOptions { return new CreateUserOptions($friendlyName, $attributes, $roleSid, $xTwilioWebhookEnabled); } /** * @param string $friendlyName The string that you assigned to describe the * resource * @param string $attributes The JSON Object string that stores * application-specific data * @param string $roleSid The SID of a service-level Role to assign to the user * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return UpdateUserOptions Options builder */ public static function update(string $friendlyName = Values::NONE, string $attributes = Values::NONE, string $roleSid = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE): UpdateUserOptions { return new UpdateUserOptions($friendlyName, $attributes, $roleSid, $xTwilioWebhookEnabled); } /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return DeleteUserOptions Options builder */ public static function delete(string $xTwilioWebhookEnabled = Values::NONE): DeleteUserOptions { return new DeleteUserOptions($xTwilioWebhookEnabled); } } class CreateUserOptions 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 * @param string $roleSid The SID of a service-level Role 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 * @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 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 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 * @param string $roleSid The SID of a service-level Role 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 * @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 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 . ']'; } } 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 . ']'; } } Conversations/V1/ParticipantConversationOptions.php 0000644 00000005563 15107452336 0016644 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Options; use Twilio\Values; abstract class ParticipantConversationOptions { /** * @param string $identity A unique string identifier for the conversation * participant as Conversation User. * @param string $address A unique string identifier for the conversation * participant who's not a Conversation User. * @return ReadParticipantConversationOptions Options builder */ public static function read(string $identity = Values::NONE, string $address = Values::NONE): ReadParticipantConversationOptions { return new ReadParticipantConversationOptions($identity, $address); } } class ReadParticipantConversationOptions extends Options { /** * @param string $identity A unique string identifier for the conversation * participant as Conversation User. * @param string $address A unique string identifier for the conversation * participant who's not a Conversation User. */ public function __construct(string $identity = Values::NONE, string $address = Values::NONE) { $this->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. * @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. * @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 . ']'; } } Conversations/V1/Service/ConversationContext.php 0000644 00000015242 15107452336 0016031 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Conversations\V1\Service\Conversation\MessageList; use Twilio\Rest\Conversations\V1\Service\Conversation\ParticipantList; use Twilio\Rest\Conversations\V1\Service\Conversation\WebhookList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property ParticipantList $participants * @property MessageList $messages * @property WebhookList $webhooks * @method \Twilio\Rest\Conversations\V1\Service\Conversation\ParticipantContext participants(string $sid) * @method \Twilio\Rest\Conversations\V1\Service\Conversation\MessageContext messages(string $sid) * @method \Twilio\Rest\Conversations\V1\Service\Conversation\WebhookContext webhooks(string $sid) */ class ConversationContext extends InstanceContext { protected $_participants; protected $_messages; protected $_webhooks; /** * Initialize the ConversationContext * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the Conversation Service that the * resource is associated with. * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function __construct(Version $version, $chatServiceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['chatServiceSid' => $chatServiceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) . '/Conversations/' . \rawurlencode($sid) . ''; } /** * Update the ConversationInstance * * @param array|Options $options Optional Arguments * @return ConversationInstance Updated ConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(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'], ]); $headers = Values::of(['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'] ); } /** * 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(['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 { $payload = $this->version->fetch('GET', $this->uri); return new ConversationInstance( $this->version, $payload, $this->solution['chatServiceSid'], $this->solution['sid'] ); } /** * 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; } /** * 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; } /** * 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) . ']'; } } Conversations/V1/Service/BindingContext.php 0000644 00000004203 15107452336 0014724 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class BindingContext extends InstanceContext { /** * Initialize the BindingContext * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the Conversation Service that the * resource is associated with. * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function __construct(Version $version, $chatServiceSid, $sid) { parent::__construct($version); // Path Solution $this->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 { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the BindingInstance * * @return BindingInstance Fetched BindingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): BindingInstance { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Conversations/V1/Service/UserInstance.php 0000644 00000012076 15107452336 0014417 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Conversations\V1\Service\User\UserConversationList; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $chatServiceSid * @property string $roleSid * @property string $identity * @property string $friendlyName * @property string $attributes * @property bool $isOnline * @property bool $isNotifiable * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class UserInstance extends InstanceResource { protected $_userConversations; /** * Initialize the UserInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $chatServiceSid The SID of the Conversation Service that the * resource is associated with * @param string $sid The SID of the User resource to fetch */ public function __construct(Version $version, array $payload, string $chatServiceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * 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) . ']'; } } Conversations/V1/Service/BindingOptions.php 0000644 00000005264 15107452336 0014743 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Options; use Twilio\Values; abstract class BindingOptions { /** * @param string[] $bindingType The push technology used by the Binding * resources to read. * @param string[] $identity The identity of Conversation User associated with * this binding. * @return ReadBindingOptions Options builder */ public static function read(array $bindingType = Values::ARRAY_NONE, array $identity = Values::ARRAY_NONE): ReadBindingOptions { return new ReadBindingOptions($bindingType, $identity); } } class ReadBindingOptions extends Options { /** * @param string[] $bindingType The push technology used by the Binding * resources to read. * @param string[] $identity The identity of Conversation User associated with * this binding. */ public function __construct(array $bindingType = Values::ARRAY_NONE, array $identity = Values::ARRAY_NONE) { $this->options['bindingType'] = $bindingType; $this->options['identity'] = $identity; } /** * The push technology used by the Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. * * @param string[] $bindingType The push technology used by the Binding * resources to read. * @return $this Fluent Builder */ public function setBindingType(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 Conversation User associated with * this binding. * @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 . ']'; } } Conversations/V1/Service/ParticipantConversationPage.php 0000644 00000002517 15107452336 0017461 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ParticipantConversationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Conversations/V1/Service/UserOptions.php 0000644 00000022170 15107452336 0014302 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Options; use Twilio\Values; abstract class UserOptions { /** * @param string $friendlyName The string that you assigned to describe the * resource * @param string $attributes The JSON Object string that stores * application-specific data * @param string $roleSid The SID of a service-level Role to assign to the user * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return CreateUserOptions Options builder */ public static function create(string $friendlyName = Values::NONE, string $attributes = Values::NONE, string $roleSid = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE): CreateUserOptions { return new CreateUserOptions($friendlyName, $attributes, $roleSid, $xTwilioWebhookEnabled); } /** * @param string $friendlyName The string that you assigned to describe the * resource * @param string $attributes The JSON Object string that stores * application-specific data * @param string $roleSid The SID of a service-level Role to assign to the user * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return UpdateUserOptions Options builder */ public static function update(string $friendlyName = Values::NONE, string $attributes = Values::NONE, string $roleSid = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE): UpdateUserOptions { return new UpdateUserOptions($friendlyName, $attributes, $roleSid, $xTwilioWebhookEnabled); } /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return DeleteUserOptions Options builder */ public static function delete(string $xTwilioWebhookEnabled = Values::NONE): DeleteUserOptions { return new DeleteUserOptions($xTwilioWebhookEnabled); } } class CreateUserOptions 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 * @param string $roleSid The SID of a service-level Role 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 * @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 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 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 * @param string $roleSid The SID of a service-level Role 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 * @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 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 . ']'; } } 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 . ']'; } } Conversations/V1/Service/ParticipantConversationOptions.php 0000644 00000005573 15107452336 0020245 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Options; use Twilio\Values; abstract class ParticipantConversationOptions { /** * @param string $identity A unique string identifier for the conversation * participant as Conversation User. * @param string $address A unique string identifier for the conversation * participant who's not a Conversation User. * @return ReadParticipantConversationOptions Options builder */ public static function read(string $identity = Values::NONE, string $address = Values::NONE): ReadParticipantConversationOptions { return new ReadParticipantConversationOptions($identity, $address); } } class ReadParticipantConversationOptions extends Options { /** * @param string $identity A unique string identifier for the conversation * participant as Conversation User. * @param string $address A unique string identifier for the conversation * participant who's not a Conversation User. */ public function __construct(string $identity = Values::NONE, string $address = Values::NONE) { $this->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. * @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. * @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 . ']'; } } Conversations/V1/Service/Configuration/WebhookPage.php 0000644 00000002335 15107452336 0017013 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service\Configuration; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class WebhookPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Conversations/V1/Service/Configuration/NotificationList.php 0000644 00000002161 15107452336 0020077 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service\Configuration; use Twilio\ListResource; use Twilio\Version; class NotificationList extends ListResource { /** * Construct the NotificationList * * @param Version $version Version that contains the resource * @param string $chatServiceSid The unique string that identifies the resource */ public function __construct(Version $version, string $chatServiceSid) { parent::__construct($version); // Path Solution $this->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]'; } } Conversations/V1/Service/Configuration/WebhookList.php 0000644 00000002123 15107452336 0017045 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service\Configuration; use Twilio\ListResource; use Twilio\Version; class WebhookList extends ListResource { /** * Construct the WebhookList * * @param Version $version Version that contains the resource * @param string $chatServiceSid The unique string that identifies the resource */ public function __construct(Version $version, string $chatServiceSid) { parent::__construct($version); // Path Solution $this->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]'; } } Conversations/V1/Service/Configuration/NotificationPage.php 0000644 00000002373 15107452336 0020045 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service\Configuration; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class NotificationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Conversations/V1/Service/Configuration/NotificationInstance.php 0000644 00000007363 15107452336 0020741 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service\Configuration; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $chatServiceSid * @property array $newMessage * @property array $addedToConversation * @property array $removedFromConversation * @property bool $logEnabled * @property string $url */ class NotificationInstance extends InstanceResource { /** * Initialize the NotificationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $chatServiceSid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $chatServiceSid) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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.Conversations.V1.NotificationInstance ' . \implode(' ', $context) . ']'; } } Conversations/V1/Service/Configuration/NotificationOptions.php 0000644 00000041731 15107452336 0020625 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service\Configuration; use Twilio\Options; use Twilio\Values; abstract class NotificationOptions { /** * @param bool $logEnabled Weather the notification logging is enabled. * @param bool $newMessageEnabled Whether to send a notification when a new * message is added to a conversation. * @param string $newMessageTemplate The template to use to create the * notification text displayed when a new * message is added to a conversation. * @param string $newMessageSound The name of the sound to play when a new * message is added to a conversation. * @param bool $newMessageBadgeCountEnabled Whether the new message badge is * enabled. * @param bool $addedToConversationEnabled Whether to send a notification when * a participant is added to a * conversation. * @param string $addedToConversationTemplate The template to use to create the * notification text displayed when * a participant is added to a * conversation. * @param string $addedToConversationSound The name of the sound to play when a * participant is added to a * conversation. * @param bool $removedFromConversationEnabled Whether to send a notification * to a user when they are removed * from a conversation. * @param string $removedFromConversationTemplate The template to use to create * the notification text * displayed to a user when they * are removed. * @param string $removedFromConversationSound The name of the sound to play to * a user when they are removed * from a conversation. * @param bool $newMessageWithMediaEnabled Whether to send a notification when * a new message with media/file * attachments is added to a * conversation. * @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. * @return UpdateNotificationOptions Options builder */ public static function update(bool $logEnabled = Values::NONE, bool $newMessageEnabled = Values::NONE, string $newMessageTemplate = Values::NONE, string $newMessageSound = Values::NONE, bool $newMessageBadgeCountEnabled = Values::NONE, bool $addedToConversationEnabled = Values::NONE, string $addedToConversationTemplate = Values::NONE, string $addedToConversationSound = Values::NONE, bool $removedFromConversationEnabled = Values::NONE, string $removedFromConversationTemplate = Values::NONE, string $removedFromConversationSound = Values::NONE, bool $newMessageWithMediaEnabled = Values::NONE, string $newMessageWithMediaTemplate = Values::NONE): UpdateNotificationOptions { return new UpdateNotificationOptions($logEnabled, $newMessageEnabled, $newMessageTemplate, $newMessageSound, $newMessageBadgeCountEnabled, $addedToConversationEnabled, $addedToConversationTemplate, $addedToConversationSound, $removedFromConversationEnabled, $removedFromConversationTemplate, $removedFromConversationSound, $newMessageWithMediaEnabled, $newMessageWithMediaTemplate); } } class UpdateNotificationOptions extends Options { /** * @param bool $logEnabled Weather the notification logging is enabled. * @param bool $newMessageEnabled Whether to send a notification when a new * message is added to a conversation. * @param string $newMessageTemplate The template to use to create the * notification text displayed when a new * message is added to a conversation. * @param string $newMessageSound The name of the sound to play when a new * message is added to a conversation. * @param bool $newMessageBadgeCountEnabled Whether the new message badge is * enabled. * @param bool $addedToConversationEnabled Whether to send a notification when * a participant is added to a * conversation. * @param string $addedToConversationTemplate The template to use to create the * notification text displayed when * a participant is added to a * conversation. * @param string $addedToConversationSound The name of the sound to play when a * participant is added to a * conversation. * @param bool $removedFromConversationEnabled Whether to send a notification * to a user when they are removed * from a conversation. * @param string $removedFromConversationTemplate The template to use to create * the notification text * displayed to a user when they * are removed. * @param string $removedFromConversationSound The name of the sound to play to * a user when they are removed * from a conversation. * @param bool $newMessageWithMediaEnabled Whether to send a notification when * a new message with media/file * attachments is added to a * conversation. * @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. */ public function __construct(bool $logEnabled = Values::NONE, bool $newMessageEnabled = Values::NONE, string $newMessageTemplate = Values::NONE, string $newMessageSound = Values::NONE, bool $newMessageBadgeCountEnabled = Values::NONE, bool $addedToConversationEnabled = Values::NONE, string $addedToConversationTemplate = Values::NONE, string $addedToConversationSound = Values::NONE, bool $removedFromConversationEnabled = Values::NONE, string $removedFromConversationTemplate = Values::NONE, string $removedFromConversationSound = Values::NONE, bool $newMessageWithMediaEnabled = Values::NONE, string $newMessageWithMediaTemplate = Values::NONE) { $this->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. * @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. * @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. * @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. * @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. * @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. * @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. * @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. * @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. * @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. * @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. * @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. * @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 . ']'; } } Conversations/V1/Service/Configuration/WebhookContext.php 0000644 00000005044 15107452336 0017563 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service\Configuration; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class WebhookContext extends InstanceContext { /** * Initialize the WebhookContext * * @param Version $version Version that contains the resource * @param string $chatServiceSid The unique ID of the [Conversation * Service](https://www.twilio.com/docs/conversations/api/service-resource) this conversation belongs to. */ public function __construct(Version $version, $chatServiceSid) { parent::__construct($version); // Path Solution $this->solution = ['chatServiceSid' => $chatServiceSid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) . '/Configuration/Webhooks'; } /** * 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new WebhookInstance($this->version, $payload, $this->solution['chatServiceSid']); } /** * Fetch the WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WebhookInstance { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Conversations/V1/Service/Configuration/NotificationContext.php 0000644 00000006744 15107452336 0020623 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service\Configuration; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class NotificationContext extends InstanceContext { /** * Initialize the NotificationContext * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the Conversation Service that the * Configuration applies to. */ public function __construct(Version $version, $chatServiceSid) { parent::__construct($version); // Path Solution $this->solution = ['chatServiceSid' => $chatServiceSid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) . '/Configuration/Notifications'; } /** * 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new NotificationInstance($this->version, $payload, $this->solution['chatServiceSid']); } /** * Fetch the NotificationInstance * * @return NotificationInstance Fetched NotificationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): NotificationInstance { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Conversations/V1/Service/Configuration/WebhookInstance.php 0000644 00000007153 15107452336 0017706 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service\Configuration; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $chatServiceSid * @property string $preWebhookUrl * @property string $postWebhookUrl * @property string[] $filters * @property string $method * @property string $url */ class WebhookInstance extends InstanceResource { /** * Initialize the WebhookInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $chatServiceSid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $chatServiceSid) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * Fetch the WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WebhookInstance { 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.WebhookInstance ' . \implode(' ', $context) . ']'; } } Conversations/V1/Service/Configuration/WebhookOptions.php 0000644 00000011350 15107452336 0017567 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service\Configuration; use Twilio\Options; use Twilio\Values; abstract class WebhookOptions { /** * @param string $preWebhookUrl The absolute url the pre-event webhook request * should be sent to. * @param string $postWebhookUrl The absolute url the post-event webhook * request should be sent to. * @param string[] $filters The list of events that your configured webhook * targets will receive. Events not configured here * will not fire. * @param string $method The HTTP method to be used when sending a webhook * request * @return UpdateWebhookOptions Options builder */ public static function update(string $preWebhookUrl = Values::NONE, string $postWebhookUrl = Values::NONE, array $filters = Values::ARRAY_NONE, string $method = Values::NONE): UpdateWebhookOptions { return new UpdateWebhookOptions($preWebhookUrl, $postWebhookUrl, $filters, $method); } } class UpdateWebhookOptions extends Options { /** * @param string $preWebhookUrl The absolute url the pre-event webhook request * should be sent to. * @param string $postWebhookUrl The absolute url the post-event webhook * request should be sent to. * @param string[] $filters The list of events that your configured webhook * targets will receive. Events not configured here * will not fire. * @param string $method The HTTP method to be used when sending a webhook * request */ public function __construct(string $preWebhookUrl = Values::NONE, string $postWebhookUrl = Values::NONE, array $filters = Values::ARRAY_NONE, string $method = Values::NONE) { $this->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. * @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 * @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 . ']'; } } Conversations/V1/Service/ConversationOptions.php 0000644 00000045732 15107452336 0016047 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Options; use Twilio\Values; abstract class ConversationOptions { /** * @param string $friendlyName The human-readable name of this conversation. * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $attributes An optional string metadata field you can use to * store any data you wish. * @param string $messagingServiceSid The unique ID of the Messaging Service * this conversation belongs to. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $state Current state of this conversation. * @param string $timersInactive ISO8601 duration when conversation will be * switched to `inactive` state. * @param string $timersClosed ISO8601 duration when conversation will be * switched to `closed` state. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return CreateConversationOptions Options builder */ public static function create(string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, string $attributes = Values::NONE, string $messagingServiceSid = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, string $state = Values::NONE, string $timersInactive = Values::NONE, string $timersClosed = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE): CreateConversationOptions { return new CreateConversationOptions($friendlyName, $uniqueName, $attributes, $messagingServiceSid, $dateCreated, $dateUpdated, $state, $timersInactive, $timersClosed, $xTwilioWebhookEnabled); } /** * @param string $friendlyName The human-readable name of this conversation. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes An optional string metadata field you can use to * store any data you wish. * @param string $messagingServiceSid The unique ID of the Messaging Service * this conversation belongs to. * @param string $state Current state of this conversation. * @param string $timersInactive ISO8601 duration when conversation will be * switched to `inactive` state. * @param string $timersClosed ISO8601 duration when conversation will be * switched to `closed` state. * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return UpdateConversationOptions Options builder */ public static function update(string $friendlyName = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, 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 $xTwilioWebhookEnabled = Values::NONE): UpdateConversationOptions { return new UpdateConversationOptions($friendlyName, $dateCreated, $dateUpdated, $attributes, $messagingServiceSid, $state, $timersInactive, $timersClosed, $uniqueName, $xTwilioWebhookEnabled); } /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return DeleteConversationOptions Options builder */ public static function delete(string $xTwilioWebhookEnabled = Values::NONE): DeleteConversationOptions { return new DeleteConversationOptions($xTwilioWebhookEnabled); } } class CreateConversationOptions extends Options { /** * @param string $friendlyName The human-readable name of this conversation. * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $attributes An optional string metadata field you can use to * store any data you wish. * @param string $messagingServiceSid The unique ID of the Messaging Service * this conversation belongs to. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $state Current state of this conversation. * @param string $timersInactive ISO8601 duration when conversation will be * switched to `inactive` state. * @param string $timersClosed ISO8601 duration when conversation will be * switched to `closed` state. * @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, string $messagingServiceSid = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, string $state = Values::NONE, string $timersInactive = Values::NONE, string $timersClosed = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE) { $this->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['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The human-readable name of this conversation, limited to 256 characters. Optional. * * @param string $friendlyName The human-readable name of this conversation. * @return $this Fluent Builder */ public function setFriendlyName(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 * @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. * @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/sms/services/api) this conversation belongs to. * * @param string $messagingServiceSid The unique ID of the Messaging Service * 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; } /** * Current state of this conversation. Can be either `active`, `inactive` or `closed` and defaults to `active` * * @param string $state Current state of this conversation. * @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. * @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. * @return $this Fluent Builder */ public function setTimersClosed(string $timersClosed): self { $this->options['timersClosed'] = $timersClosed; 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 UpdateConversationOptions extends Options { /** * @param string $friendlyName The human-readable name of this conversation. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes An optional string metadata field you can use to * store any data you wish. * @param string $messagingServiceSid The unique ID of the Messaging Service * this conversation belongs to. * @param string $state Current state of this conversation. * @param string $timersInactive ISO8601 duration when conversation will be * switched to `inactive` state. * @param string $timersClosed ISO8601 duration when conversation will be * switched to `closed` state. * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header */ public function __construct(string $friendlyName = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, 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 $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['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The human-readable name of this conversation, limited to 256 characters. Optional. * * @param string $friendlyName The human-readable name of this conversation. * @return $this Fluent Builder */ public function setFriendlyName(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. * @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/sms/services/api) this conversation belongs to. * * @param string $messagingServiceSid The unique ID of the Messaging Service * this conversation belongs to. * @return $this Fluent Builder */ public function setMessagingServiceSid(string $messagingServiceSid): self { $this->options['messagingServiceSid'] = $messagingServiceSid; return $this; } /** * Current state of this conversation. Can be either `active`, `inactive` or `closed` and defaults to `active` * * @param string $state Current state of this conversation. * @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. * @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. * @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 * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; 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 . ']'; } } 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 . ']'; } } Conversations/V1/Service/Conversation/WebhookPage.php 0000644 00000002471 15107452336 0016657 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service\Conversation; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class WebhookPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Conversations/V1/Service/Conversation/ParticipantList.php 0000644 00000015260 15107452336 0017576 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service\Conversation; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ParticipantList extends ListResource { /** * Construct the ParticipantList * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the Conversation Service that the * resource is associated with. * @param string $conversationSid The unique ID of the Conversation for this * participant. */ public function __construct(Version $version, string $chatServiceSid, string $conversationSid) { parent::__construct($version); // Path Solution $this->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(['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'] ); } /** * 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']); } /** * 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); } /** * 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]'; } } Conversations/V1/Service/Conversation/WebhookList.php 0000644 00000015025 15107452336 0016715 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service\Conversation; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class WebhookList extends ListResource { /** * Construct the WebhookList * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the Conversation Service that the * resource is associated with. * @param string $conversationSid The unique ID of the Conversation for this * webhook. */ public function __construct(Version $version, string $chatServiceSid, string $conversationSid) { parent::__construct($version); // Path Solution $this->solution = ['chatServiceSid' => $chatServiceSid, 'conversationSid' => $conversationSid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) . '/Conversations/' . \rawurlencode($conversationSid) . '/Webhooks'; } /** * Create the WebhookInstance * * @param string $target The target of this webhook. * @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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new WebhookInstance( $this->version, $payload, $this->solution['chatServiceSid'], $this->solution['conversationSid'] ); } /** * 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']); } /** * 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); } /** * 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]'; } } Conversations/V1/Service/Conversation/ParticipantInstance.php 0000644 00000012532 15107452336 0020426 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service\Conversation; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $chatServiceSid * @property string $conversationSid * @property string $sid * @property string $identity * @property string $attributes * @property array $messagingBinding * @property string $roleSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property int $lastReadMessageIndex * @property string $lastReadTimestamp */ class ParticipantInstance extends InstanceResource { /** * Initialize the ParticipantInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $chatServiceSid The SID of the Conversation Service that the * resource is associated with. * @param string $conversationSid The unique ID of the Conversation for this * participant. * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function __construct(Version $version, array $payload, string $chatServiceSid, string $conversationSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Conversations/V1/Service/Conversation/MessageOptions.php 0000644 00000036553 15107452336 0017434 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service\Conversation; use Twilio\Options; use Twilio\Values; abstract class MessageOptions { /** * @param string $author The channel specific identifier of the message's * author. * @param string $body The content of the message. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes A string metadata field you can use to store any * data you wish. * @param string $mediaSid The Media SID to be attached to the new Message. * @param string $contentSid The unique ID of the multi-channel Rich Content * template. * @param string $contentVariables A structurally valid JSON string that * contains values to resolve Rich Content * template variables. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return CreateMessageOptions Options builder */ public static function create(string $author = Values::NONE, string $body = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, string $attributes = Values::NONE, string $mediaSid = Values::NONE, string $contentSid = Values::NONE, string $contentVariables = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE): CreateMessageOptions { return new CreateMessageOptions($author, $body, $dateCreated, $dateUpdated, $attributes, $mediaSid, $contentSid, $contentVariables, $xTwilioWebhookEnabled); } /** * @param string $author The channel specific identifier of the message's * author. * @param string $body The content of the message. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes A string metadata field you can use to store any * data you wish. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return UpdateMessageOptions Options builder */ public static function update(string $author = Values::NONE, string $body = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, string $attributes = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE): UpdateMessageOptions { return new UpdateMessageOptions($author, $body, $dateCreated, $dateUpdated, $attributes, $xTwilioWebhookEnabled); } /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return DeleteMessageOptions Options builder */ public static function delete(string $xTwilioWebhookEnabled = Values::NONE): DeleteMessageOptions { return new DeleteMessageOptions($xTwilioWebhookEnabled); } /** * @param string $order The sort order of the returned messages * @return ReadMessageOptions Options builder */ public static function read(string $order = Values::NONE): ReadMessageOptions { return new ReadMessageOptions($order); } } class CreateMessageOptions extends Options { /** * @param string $author The channel specific identifier of the message's * author. * @param string $body The content of the message. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes A string metadata field you can use to store any * data you wish. * @param string $mediaSid The Media SID to be attached to the new Message. * @param string $contentSid The unique ID of the multi-channel Rich Content * template. * @param string $contentVariables A structurally valid JSON string that * contains values to resolve Rich Content * template variables. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header */ public function __construct(string $author = Values::NONE, string $body = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, string $attributes = Values::NONE, string $mediaSid = Values::NONE, string $contentSid = Values::NONE, string $contentVariables = 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['mediaSid'] = $mediaSid; $this->options['contentSid'] = $contentSid; $this->options['contentVariables'] = $contentVariables; $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. * @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. * @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. * @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. * @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-api) 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 * template. * @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 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 UpdateMessageOptions extends Options { /** * @param string $author The channel specific identifier of the message's * author. * @param string $body The content of the message. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes A string metadata field you can use to store any * data you wish. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header */ public function __construct(string $author = Values::NONE, string $body = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, string $attributes = 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['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. * @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. * @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. * @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. * @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.Conversations.V1.UpdateMessageOptions ' . $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 */ 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 * @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 . ']'; } } Conversations/V1/Service/Conversation/ParticipantContext.php 0000644 00000010310 15107452336 0020276 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service\Conversation; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class ParticipantContext extends InstanceContext { /** * Initialize the ParticipantContext * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the Conversation Service that the * resource is associated with. * @param string $conversationSid The unique ID of the Conversation for this * participant. * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function __construct(Version $version, $chatServiceSid, $conversationSid, $sid) { parent::__construct($version); // Path Solution $this->solution = [ 'chatServiceSid' => $chatServiceSid, 'conversationSid' => $conversationSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) . '/Conversations/' . \rawurlencode($conversationSid) . '/Participants/' . \rawurlencode($sid) . ''; } /** * Update the ParticipantInstance * * @param array|Options $options Optional Arguments * @return ParticipantInstance Updated ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function update(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(['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'] ); } /** * 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(['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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Conversations/V1/Service/Conversation/MessagePage.php 0000644 00000002471 15107452336 0016645 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service\Conversation; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MessagePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Conversations/V1/Service/Conversation/MessageList.php 0000644 00000015525 15107452336 0016710 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service\Conversation; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class MessageList extends ListResource { /** * Construct the MessageList * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the Conversation Service that the * resource is associated with. * @param string $conversationSid The unique ID of the Conversation for this * message. */ public function __construct(Version $version, string $chatServiceSid, string $conversationSid) { parent::__construct($version); // Path Solution $this->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'], ]); $headers = Values::of(['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'] ); } /** * 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']); } /** * 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); } /** * Retrieve a single page of MessageInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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]'; } } Conversations/V1/Service/Conversation/WebhookContext.php 0000644 00000007163 15107452336 0017432 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service\Conversation; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class WebhookContext extends InstanceContext { /** * Initialize the WebhookContext * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the Conversation Service that the * resource is associated with. * @param string $conversationSid The unique ID of the Conversation for this * webhook. * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function __construct(Version $version, $chatServiceSid, $conversationSid, $sid) { parent::__construct($version); // Path Solution $this->solution = [ 'chatServiceSid' => $chatServiceSid, 'conversationSid' => $conversationSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) . '/Conversations/' . \rawurlencode($conversationSid) . '/Webhooks/' . \rawurlencode($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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new WebhookInstance( $this->version, $payload, $this->solution['chatServiceSid'], $this->solution['conversationSid'], $this->solution['sid'] ); } /** * Delete the WebhookInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WebhookInstance { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Conversations/V1/Service/Conversation/ParticipantOptions.php 0000644 00000052371 15107452336 0020322 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service\Conversation; use Twilio\Options; use Twilio\Values; abstract class ParticipantOptions { /** * @param string $identity A unique string identifier for the conversation * participant as Conversation User. * @param string $messagingBindingAddress The address of the participant's * device. * @param string $messagingBindingProxyAddress The address of the Twilio phone * number that the participant is * in contact with. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes An optional string metadata field you can use to * store any data you wish. * @param string $messagingBindingProjectedAddress The address of the Twilio * phone number that is used in * Group MMS. * @param string $roleSid The SID of a conversation-level Role to assign to the * participant * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return CreateParticipantOptions Options builder */ public static function create(string $identity = Values::NONE, string $messagingBindingAddress = Values::NONE, string $messagingBindingProxyAddress = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, string $attributes = Values::NONE, string $messagingBindingProjectedAddress = Values::NONE, string $roleSid = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE): CreateParticipantOptions { return new CreateParticipantOptions($identity, $messagingBindingAddress, $messagingBindingProxyAddress, $dateCreated, $dateUpdated, $attributes, $messagingBindingProjectedAddress, $roleSid, $xTwilioWebhookEnabled); } /** * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $identity A unique string identifier for the conversation * participant as Conversation User. * @param string $attributes An optional string metadata field you can use to * store any data you wish. * @param string $roleSid The SID of a conversation-level Role to assign to the * participant * @param string $messagingBindingProxyAddress The address of the Twilio phone * number that the participant is * in contact with. * @param string $messagingBindingProjectedAddress The address of the Twilio * phone number that is used in * Group MMS. * @param int $lastReadMessageIndex Index of last “read” message in the * Conversation for the Participant. * @param string $lastReadTimestamp Timestamp of last “read” message in the * Conversation for the Participant. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return UpdateParticipantOptions Options builder */ public static function update(\DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, string $identity = Values::NONE, string $attributes = Values::NONE, string $roleSid = Values::NONE, string $messagingBindingProxyAddress = Values::NONE, string $messagingBindingProjectedAddress = Values::NONE, int $lastReadMessageIndex = Values::NONE, string $lastReadTimestamp = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE): UpdateParticipantOptions { return new UpdateParticipantOptions($dateCreated, $dateUpdated, $identity, $attributes, $roleSid, $messagingBindingProxyAddress, $messagingBindingProjectedAddress, $lastReadMessageIndex, $lastReadTimestamp, $xTwilioWebhookEnabled); } /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return DeleteParticipantOptions Options builder */ public static function delete(string $xTwilioWebhookEnabled = Values::NONE): DeleteParticipantOptions { return new DeleteParticipantOptions($xTwilioWebhookEnabled); } } class CreateParticipantOptions extends Options { /** * @param string $identity A unique string identifier for the conversation * participant as Conversation User. * @param string $messagingBindingAddress The address of the participant's * device. * @param string $messagingBindingProxyAddress The address of the Twilio phone * number that the participant is * in contact with. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes An optional string metadata field you can use to * store any data you wish. * @param string $messagingBindingProjectedAddress The address of the Twilio * phone number that is used in * Group MMS. * @param string $roleSid The SID of a conversation-level Role to assign to the * participant * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header */ public function __construct(string $identity = Values::NONE, string $messagingBindingAddress = Values::NONE, string $messagingBindingProxyAddress = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, string $attributes = Values::NONE, string $messagingBindingProjectedAddress = Values::NONE, string $roleSid = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE) { $this->options['identity'] = $identity; $this->options['messagingBindingAddress'] = $messagingBindingAddress; $this->options['messagingBindingProxyAddress'] = $messagingBindingProxyAddress; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; $this->options['messagingBindingProjectedAddress'] = $messagingBindingProjectedAddress; $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 to communicate. Limited to 256 characters. * * @param string $identity A unique string identifier for the conversation * participant as Conversation User. * @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. * @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 that the participant is * in contact with. * @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. * @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. * @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 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 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 $identity A unique string identifier for the conversation * participant as Conversation User. * @param string $attributes An optional string metadata field you can use to * store any data you wish. * @param string $roleSid The SID of a conversation-level Role to assign to the * participant * @param string $messagingBindingProxyAddress The address of the Twilio phone * number that the participant is * in contact with. * @param string $messagingBindingProjectedAddress The address of the Twilio * phone number that is used in * Group MMS. * @param int $lastReadMessageIndex Index of last “read” message in the * Conversation for the Participant. * @param string $lastReadTimestamp Timestamp of last “read” message in the * Conversation for the Participant. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header */ public function __construct(\DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, string $identity = Values::NONE, string $attributes = Values::NONE, string $roleSid = Values::NONE, string $messagingBindingProxyAddress = Values::NONE, string $messagingBindingProjectedAddress = Values::NONE, int $lastReadMessageIndex = Values::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 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; } /** * 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 to communicate. Limited to 256 characters. * * @param string $identity A unique string identifier for the conversation * participant as Conversation User. * @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. * @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 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. * @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. * @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 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 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 . ']'; } } 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 . ']'; } } Conversations/V1/Service/Conversation/MessageContext.php 0000644 00000013274 15107452336 0017420 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service\Conversation; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Conversations\V1\Service\Conversation\Message\DeliveryReceiptList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property DeliveryReceiptList $deliveryReceipts * @method \Twilio\Rest\Conversations\V1\Service\Conversation\Message\DeliveryReceiptContext deliveryReceipts(string $sid) */ class MessageContext extends InstanceContext { protected $_deliveryReceipts; /** * Initialize the MessageContext * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the Conversation Service that the * resource is associated with. * @param string $conversationSid The unique ID of the Conversation for this * message. * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function __construct(Version $version, $chatServiceSid, $conversationSid, $sid) { parent::__construct($version); // Path Solution $this->solution = [ 'chatServiceSid' => $chatServiceSid, 'conversationSid' => $conversationSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) . '/Conversations/' . \rawurlencode($conversationSid) . '/Messages/' . \rawurlencode($sid) . ''; } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update(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'], ]); $headers = Values::of(['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'] ); } /** * 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(['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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Conversations/V1/Service/Conversation/MessageInstance.php 0000644 00000013360 15107452336 0017534 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service\Conversation; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Conversations\V1\Service\Conversation\Message\DeliveryReceiptList; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $chatServiceSid * @property string $conversationSid * @property string $sid * @property int $index * @property string $author * @property string $body * @property array[] $media * @property string $attributes * @property string $participantSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property array $delivery * @property string $url * @property array $links * @property string $contentSid */ class MessageInstance extends InstanceResource { protected $_deliveryReceipts; /** * Initialize the MessageInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $chatServiceSid The SID of the Conversation Service that the * resource is associated with. * @param string $conversationSid The unique ID of the Conversation for this * message. * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function __construct(Version $version, array $payload, string $chatServiceSid, string $conversationSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * 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) . ']'; } } Conversations/V1/Service/Conversation/ParticipantPage.php 0000644 00000002521 15107452336 0017533 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service\Conversation; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ParticipantPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Conversations/V1/Service/Conversation/WebhookInstance.php 0000644 00000011352 15107452336 0017545 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service\Conversation; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $chatServiceSid * @property string $conversationSid * @property string $target * @property string $url * @property array $configuration * @property \DateTime $dateCreated * @property \DateTime $dateUpdated */ class WebhookInstance extends InstanceResource { /** * Initialize the WebhookInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $chatServiceSid The SID of the Conversation Service that the * resource is associated with. * @param string $conversationSid The unique ID of the Conversation for this * webhook. * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function __construct(Version $version, array $payload, string $chatServiceSid, string $conversationSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Conversations/V1/Service/Conversation/WebhookOptions.php 0000644 00000027055 15107452336 0017443 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service\Conversation; use Twilio\Options; use Twilio\Values; abstract class WebhookOptions { /** * @param string $configurationUrl The absolute url the webhook request should * be sent to. * @param string $configurationMethod The HTTP method to be used when sending a * webhook request. * @param string[] $configurationFilters The list of events, firing webhook * event for this Conversation. * @param string[] $configurationTriggers The list of keywords, firing webhook * event for this Conversation. * @param string $configurationFlowSid The studio flow SID, where the webhook * should be sent to. * @param int $configurationReplayAfter The message index for which and it's * successors the webhook will be replayed. * @return CreateWebhookOptions Options builder */ public static function create(string $configurationUrl = Values::NONE, string $configurationMethod = Values::NONE, array $configurationFilters = Values::ARRAY_NONE, array $configurationTriggers = Values::ARRAY_NONE, string $configurationFlowSid = Values::NONE, int $configurationReplayAfter = Values::NONE): CreateWebhookOptions { return new CreateWebhookOptions($configurationUrl, $configurationMethod, $configurationFilters, $configurationTriggers, $configurationFlowSid, $configurationReplayAfter); } /** * @param string $configurationUrl The absolute url the webhook request should * be sent to. * @param string $configurationMethod The HTTP method to be used when sending a * webhook request. * @param string[] $configurationFilters The list of events, firing webhook * event for this Conversation. * @param string[] $configurationTriggers The list of keywords, firing webhook * event for this Conversation. * @param string $configurationFlowSid The studio flow SID, where the webhook * should be sent to. * @return UpdateWebhookOptions Options builder */ public static function update(string $configurationUrl = Values::NONE, string $configurationMethod = Values::NONE, array $configurationFilters = Values::ARRAY_NONE, array $configurationTriggers = Values::ARRAY_NONE, string $configurationFlowSid = Values::NONE): UpdateWebhookOptions { return new UpdateWebhookOptions($configurationUrl, $configurationMethod, $configurationFilters, $configurationTriggers, $configurationFlowSid); } } class CreateWebhookOptions extends Options { /** * @param string $configurationUrl The absolute url the webhook request should * be sent to. * @param string $configurationMethod The HTTP method to be used when sending a * webhook request. * @param string[] $configurationFilters The list of events, firing webhook * event for this Conversation. * @param string[] $configurationTriggers The list of keywords, firing webhook * event for this Conversation. * @param string $configurationFlowSid The studio flow SID, where the webhook * should be sent to. * @param int $configurationReplayAfter The message index for which and it's * successors the webhook will be replayed. */ public function __construct(string $configurationUrl = Values::NONE, string $configurationMethod = Values::NONE, array $configurationFilters = Values::ARRAY_NONE, array $configurationTriggers = Values::ARRAY_NONE, string $configurationFlowSid = Values::NONE, int $configurationReplayAfter = Values::NONE) { $this->options['configurationUrl'] = $configurationUrl; $this->options['configurationMethod'] = $configurationMethod; $this->options['configurationFilters'] = $configurationFilters; $this->options['configurationTriggers'] = $configurationTriggers; $this->options['configurationFlowSid'] = $configurationFlowSid; $this->options['configurationReplayAfter'] = $configurationReplayAfter; } /** * The absolute url the webhook request should be sent to. * * @param string $configurationUrl The absolute url the webhook request should * be sent to. * @return $this Fluent Builder */ public function setConfigurationUrl(string $configurationUrl): self { $this->options['configurationUrl'] = $configurationUrl; return $this; } /** * The HTTP method to be used when sending a webhook request. * * @param string $configurationMethod The HTTP method to be used when sending a * webhook request. * @return $this Fluent Builder */ public function setConfigurationMethod(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. * @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 The HTTP method to be used when sending a * webhook request. * @param string[] $configurationFilters The list of events, firing webhook * event for this Conversation. * @param string[] $configurationTriggers The list of keywords, firing webhook * event for this Conversation. * @param string $configurationFlowSid The studio flow SID, where the webhook * should be sent to. */ public function __construct(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; } /** * The HTTP method to be used when sending a webhook request. * * @param string $configurationMethod The HTTP method to be used when sending a * webhook request. * @return $this Fluent Builder */ public function setConfigurationMethod(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 . ']'; } } Conversations/V1/Service/Conversation/Message/DeliveryReceiptContext.php 0000644 00000005033 15107452336 0022511 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service\Conversation\Message; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class DeliveryReceiptContext extends InstanceContext { /** * Initialize the DeliveryReceiptContext * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the Conversation Service that the * resource is associated with. * @param string $conversationSid The unique ID of the Conversation for this * delivery receipt. * @param string $messageSid The SID of the message the delivery receipt * belongs to. * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function __construct(Version $version, $chatServiceSid, $conversationSid, $messageSid, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Conversations/V1/Service/Conversation/Message/DeliveryReceiptList.php 0000644 00000013216 15107452336 0022002 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service\Conversation\Message; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class DeliveryReceiptList extends ListResource { /** * Construct the DeliveryReceiptList * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the Conversation Service that the * resource is associated with. * @param string $conversationSid The unique ID of the Conversation for this * message. * @param string $messageSid The SID of the message the delivery receipt * belongs to */ public function __construct(Version $version, string $chatServiceSid, string $conversationSid, string $messageSid) { parent::__construct($version); // Path Solution $this->solution = [ 'chatServiceSid' => $chatServiceSid, 'conversationSid' => $conversationSid, 'messageSid' => $messageSid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) . '/Conversations/' . \rawurlencode($conversationSid) . '/Messages/' . \rawurlencode($messageSid) . '/Receipts'; } /** * 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']); } /** * 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); } /** * 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]'; } } Conversations/V1/Service/Conversation/Message/DeliveryReceiptInstance.php 0000644 00000011406 15107452336 0022632 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service\Conversation\Message; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $chatServiceSid * @property string $conversationSid * @property string $messageSid * @property string $sid * @property string $channelMessageSid * @property string $participantSid * @property string $status * @property int $errorCode * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class DeliveryReceiptInstance extends InstanceResource { /** * Initialize the DeliveryReceiptInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $chatServiceSid The SID of the Conversation Service that the * resource is associated with. * @param string $conversationSid The unique ID of the Conversation for this * message. * @param string $messageSid The SID of the message the delivery receipt * belongs to * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function __construct(Version $version, array $payload, string $chatServiceSid, string $conversationSid, string $messageSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Conversations/V1/Service/Conversation/Message/DeliveryReceiptPage.php 0000644 00000002644 15107452336 0021746 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service\Conversation\Message; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class DeliveryReceiptPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Conversations/V1/Service/ConfigurationList.php 0000644 00000006503 15107452336 0015455 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Conversations\V1\Service\Configuration\NotificationList; use Twilio\Rest\Conversations\V1\Service\Configuration\WebhookList; use Twilio\Version; /** * @property NotificationList $notifications * @property WebhookList $webhooks * @method \Twilio\Rest\Conversations\V1\Service\Configuration\NotificationContext notifications() * @method \Twilio\Rest\Conversations\V1\Service\Configuration\WebhookContext webhooks() */ class ConfigurationList extends ListResource { protected $_notifications = null; protected $_webhooks = null; /** * Construct the ConfigurationList * * @param Version $version Version that contains the resource * @param string $chatServiceSid The unique string that identifies the resource */ public function __construct(Version $version, string $chatServiceSid) { parent::__construct($version); // Path Solution $this->solution = ['chatServiceSid' => $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; } /** * Constructs a ConfigurationContext */ public function getContext(): ConfigurationContext { return new ConfigurationContext($this->version, $this->solution['chatServiceSid']); } /** * 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]'; } } Conversations/V1/Service/ParticipantConversationList.php 0000644 00000012371 15107452336 0017517 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ParticipantConversationList extends ListResource { /** * Construct the ParticipantConversationList * * @param Version $version Version that contains the resource * @param string $chatServiceSid The unique ID of the Conversation Service this * conversation belongs to. */ public function __construct(Version $version, string $chatServiceSid) { parent::__construct($version); // Path Solution $this->solution = ['chatServiceSid' => $chatServiceSid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) . '/ParticipantConversations'; } /** * 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']); } /** * 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); } /** * Retrieve a single page of ParticipantConversationInstance records from the * API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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]'; } } Conversations/V1/Service/ConfigurationContext.php 0000644 00000005165 15107452336 0016171 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class ConfigurationContext extends InstanceContext { /** * Initialize the ConfigurationContext * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the Service configuration resource * to fetch */ public function __construct(Version $version, $chatServiceSid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } Conversations/V1/Service/ConfigurationPage.php 0000644 00000002345 15107452336 0015416 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ConfigurationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Conversations/V1/Service/ConfigurationInstance.php 0000644 00000007547 15107452336 0016317 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $chatServiceSid * @property string $defaultConversationCreatorRoleSid * @property string $defaultConversationRoleSid * @property string $defaultChatServiceRoleSid * @property string $url * @property array $links * @property bool $reachabilityEnabled */ class ConfigurationInstance extends InstanceResource { /** * Initialize the ConfigurationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $chatServiceSid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $chatServiceSid) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Conversations/V1/Service/ConversationInstance.php 0000644 00000013443 15107452336 0016152 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Conversations\V1\Service\Conversation\MessageList; use Twilio\Rest\Conversations\V1\Service\Conversation\ParticipantList; use Twilio\Rest\Conversations\V1\Service\Conversation\WebhookList; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $chatServiceSid * @property string $messagingServiceSid * @property string $sid * @property string $friendlyName * @property string $uniqueName * @property string $attributes * @property string $state * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property array $timers * @property string $url * @property array $links * @property array $bindings */ class ConversationInstance extends InstanceResource { protected $_participants; protected $_messages; protected $_webhooks; /** * Initialize the ConversationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $chatServiceSid The unique ID of the Conversation Service this * conversation belongs to. * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function __construct(Version $version, array $payload, string $chatServiceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Access the participants */ protected function getParticipants(): ParticipantList { return $this->proxy()->participants; } /** * Access the messages */ protected function getMessages(): MessageList { return $this->proxy()->messages; } /** * Access the webhooks */ protected function getWebhooks(): WebhookList { return $this->proxy()->webhooks; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Conversations/V1/Service/ConversationPage.php 0000644 00000002337 15107452336 0015262 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ConversationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Conversations/V1/Service/UserContext.php 0000644 00000011746 15107452336 0014302 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Conversations\V1\Service\User\UserConversationList; use Twilio\Values; use Twilio\Version; /** * @property UserConversationList $userConversations * @method \Twilio\Rest\Conversations\V1\Service\User\UserConversationContext userConversations(string $conversationSid) */ class UserContext extends InstanceContext { protected $_userConversations; /** * Initialize the UserContext * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the Conversation Service to fetch * the resource from * @param string $sid The SID of the User resource to fetch */ public function __construct(Version $version, $chatServiceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['chatServiceSid' => $chatServiceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) . '/Users/' . \rawurlencode($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(['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'] ); } /** * 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(['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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Conversations/V1/Service/BindingPage.php 0000644 00000002301 15107452336 0014151 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class BindingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Conversations/V1/Service/ParticipantConversationInstance.php 0000644 00000007540 15107452336 0020352 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $chatServiceSid * @property string $participantSid * @property string $participantUserSid * @property string $participantIdentity * @property array $participantMessagingBinding * @property string $conversationSid * @property string $conversationUniqueName * @property string $conversationFriendlyName * @property string $conversationAttributes * @property \DateTime $conversationDateCreated * @property \DateTime $conversationDateUpdated * @property string $conversationCreatedBy * @property string $conversationState * @property array $conversationTimers * @property array $links */ class ParticipantConversationInstance extends InstanceResource { /** * Initialize the ParticipantConversationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $chatServiceSid The unique ID of the Conversation Service this * conversation belongs to. */ public function __construct(Version $version, array $payload, string $chatServiceSid) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Conversations/V1/Service/ConversationList.php 0000644 00000014357 15107452336 0015326 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ConversationList extends ListResource { /** * Construct the ConversationList * * @param Version $version Version that contains the resource * @param string $chatServiceSid The unique ID of the Conversation Service this * conversation belongs to. */ public function __construct(Version $version, string $chatServiceSid) { parent::__construct($version); // Path Solution $this->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'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled'], ]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new ConversationInstance($this->version, $payload, $this->solution['chatServiceSid']); } /** * Streams ConversationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * Reads ConversationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ConversationInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of ConversationInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ConversationPage Page of ConversationInstance */ public function page($pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): ConversationPage { $params = Values::of(['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. */ 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]'; } } Conversations/V1/Service/User/UserConversationInstance.php 0000644 00000013463 15107452336 0017731 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service\User; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $chatServiceSid * @property string $conversationSid * @property int $unreadMessagesCount * @property int $lastReadMessageIndex * @property string $participantSid * @property string $userSid * @property string $friendlyName * @property string $conversationState * @property array $timers * @property string $attributes * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $createdBy * @property string $notificationLevel * @property string $uniqueName * @property string $url * @property array $links */ class UserConversationInstance extends InstanceResource { /** * Initialize the UserConversationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $chatServiceSid The unique ID of the Conversation Service this * conversation belongs to. * @param string $userSid The unique ID for the User. * @param string $conversationSid The unique SID identifier of the Conversation. */ public function __construct(Version $version, array $payload, string $chatServiceSid, string $userSid, string $conversationSid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Conversations/V1/Service/User/UserConversationPage.php 0000644 00000002527 15107452336 0017040 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service\User; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UserConversationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Conversations/V1/Service/User/UserConversationOptions.php 0000644 00000006606 15107452336 0017621 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service\User; use Twilio\Options; use Twilio\Values; abstract class UserConversationOptions { /** * @param string $notificationLevel The Notification Level of this User * Conversation. * @param \DateTime $lastReadTimestamp The date of the last message read in * conversation by the user. * @param int $lastReadMessageIndex The index of the last read Message. * @return UpdateUserConversationOptions Options builder */ public static function update(string $notificationLevel = Values::NONE, \DateTime $lastReadTimestamp = Values::NONE, int $lastReadMessageIndex = Values::NONE): UpdateUserConversationOptions { return new UpdateUserConversationOptions($notificationLevel, $lastReadTimestamp, $lastReadMessageIndex); } } class UpdateUserConversationOptions extends Options { /** * @param string $notificationLevel The Notification Level of this User * Conversation. * @param \DateTime $lastReadTimestamp The date of the last message read in * conversation by the user. * @param int $lastReadMessageIndex The index of the last read Message. */ public function __construct(string $notificationLevel = Values::NONE, \DateTime $lastReadTimestamp = Values::NONE, int $lastReadMessageIndex = Values::NONE) { $this->options['notificationLevel'] = $notificationLevel; $this->options['lastReadTimestamp'] = $lastReadTimestamp; $this->options['lastReadMessageIndex'] = $lastReadMessageIndex; } /** * The Notification Level of this User Conversation. One of `default` or `muted`. * * @param string $notificationLevel The Notification Level of this User * Conversation. * @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. * @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 read Message. * @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 . ']'; } } Conversations/V1/Service/User/UserConversationContext.php 0000644 00000006717 15107452336 0017615 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service\User; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class UserConversationContext extends InstanceContext { /** * Initialize the UserConversationContext * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the Conversation Service that the * resource is associated with. * @param string $userSid The unique SID identifier of the User. * @param string $conversationSid The unique SID identifier of the Conversation. */ public function __construct(Version $version, $chatServiceSid, $userSid, $conversationSid) { parent::__construct($version); // Path Solution $this->solution = [ 'chatServiceSid' => $chatServiceSid, 'userSid' => $userSid, 'conversationSid' => $conversationSid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) . '/Users/' . \rawurlencode($userSid) . '/Conversations/' . \rawurlencode($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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new UserConversationInstance( $this->version, $payload, $this->solution['chatServiceSid'], $this->solution['userSid'], $this->solution['conversationSid'] ); } /** * Delete the UserConversationInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the UserConversationInstance * * @return UserConversationInstance Fetched UserConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserConversationInstance { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Conversations/V1/Service/User/UserConversationList.php 0000644 00000012353 15107452336 0017075 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service\User; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class UserConversationList extends ListResource { /** * Construct the UserConversationList * * @param Version $version Version that contains the resource * @param string $chatServiceSid The unique ID of the Conversation Service this * conversation belongs to. * @param string $userSid The unique ID for the User. */ public function __construct(Version $version, string $chatServiceSid, string $userSid) { parent::__construct($version); // Path Solution $this->solution = ['chatServiceSid' => $chatServiceSid, 'userSid' => $userSid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) . '/Users/' . \rawurlencode($userSid) . '/Conversations'; } /** * 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']); } /** * 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); } /** * 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. */ 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]'; } } Conversations/V1/Service/UserPage.php 0000644 00000002257 15107452336 0013527 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UserPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Conversations/V1/Service/RolePage.php 0000644 00000002257 15107452336 0013512 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RolePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Conversations/V1/Service/RoleList.php 0000644 00000013144 15107452336 0013546 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class RoleList extends ListResource { /** * Construct the RoleList * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the Conversation Service that the * resource is associated with */ public function __construct(Version $version, string $chatServiceSid) { parent::__construct($version); // Path Solution $this->solution = ['chatServiceSid' => $chatServiceSid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) . '/Roles'; } /** * Create the RoleInstance * * @param string $friendlyName A string to describe the new resource * @param string $type The type of role * @param string[] $permission A permission the role should have * @return RoleInstance 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; }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new RoleInstance($this->version, $payload, $this->solution['chatServiceSid']); } /** * 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']); } /** * 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); } /** * 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 fetch */ 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]'; } } Conversations/V1/Service/BindingInstance.php 0000644 00000010430 15107452336 0015043 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $chatServiceSid * @property string $credentialSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $endpoint * @property string $identity * @property string $bindingType * @property string[] $messageTypes * @property string $url */ class BindingInstance extends InstanceResource { /** * Initialize the BindingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $chatServiceSid The SID of the Conversation Service that the * resource is associated with. * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function __construct(Version $version, array $payload, string $chatServiceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Conversations/V1/Service/BindingList.php 0000644 00000012633 15107452336 0014221 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class BindingList extends ListResource { /** * Construct the BindingList * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the Conversation Service that the * resource is associated with. */ public function __construct(Version $version, string $chatServiceSid) { parent::__construct($version); // Path Solution $this->solution = ['chatServiceSid' => $chatServiceSid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) . '/Bindings'; } /** * Streams BindingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of BindingInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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' => Serialize::map($options['bindingType'], function($e) { return $e; }), 'Identity' => Serialize::map($options['identity'], function($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new BindingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of BindingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return 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 A 34 character string that uniquely identifies this * resource. */ 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]'; } } Conversations/V1/Service/UserList.php 0000644 00000013325 15107452336 0013564 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class UserList extends ListResource { /** * Construct the UserList * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the Conversation Service that the * resource is associated with */ public function __construct(Version $version, string $chatServiceSid) { parent::__construct($version); // Path Solution $this->solution = ['chatServiceSid' => $chatServiceSid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) . '/Users'; } /** * Create the UserInstance * * @param string $identity The string that identifies the resource's User * @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(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled'], ]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new UserInstance($this->version, $payload, $this->solution['chatServiceSid']); } /** * 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']); } /** * 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); } /** * 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 fetch */ 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]'; } } Conversations/V1/Service/RoleContext.php 0000644 00000005317 15107452336 0014262 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class RoleContext extends InstanceContext { /** * Initialize the RoleContext * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the Conversation Service to fetch * the resource from * @param string $sid The SID of the Role resource to fetch */ public function __construct(Version $version, $chatServiceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['chatServiceSid' => $chatServiceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) . '/Roles/' . \rawurlencode($sid) . ''; } /** * Update the RoleInstance * * @param string[] $permission A permission the role should have * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $permission): RoleInstance { $data = Values::of(['Permission' => Serialize::map($permission, function($e) { return $e; }), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new RoleInstance( $this->version, $payload, $this->solution['chatServiceSid'], $this->solution['sid'] ); } /** * Delete the RoleInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the RoleInstance * * @return RoleInstance Fetched RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RoleInstance { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Conversations/V1/Service/RoleInstance.php 0000644 00000010501 15107452336 0014371 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $chatServiceSid * @property string $friendlyName * @property string $type * @property string[] $permissions * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class RoleInstance extends InstanceResource { /** * Initialize the RoleInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $chatServiceSid The SID of the Conversation Service that the * resource is associated with * @param string $sid The SID of the Role resource to fetch */ public function __construct(Version $version, array $payload, string $chatServiceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Update the RoleInstance * * @param string[] $permission A permission the role should have * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $permission): RoleInstance { return $this->proxy()->update($permission); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Conversations/V1/Service/ConfigurationOptions.php 0000644 00000013253 15107452336 0016175 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Options; use Twilio\Values; abstract class ConfigurationOptions { /** * @param string $defaultConversationCreatorRoleSid The role assigned to a * conversation creator when * they join a new conversation * @param string $defaultConversationRoleSid The role assigned to users when * they are added to a conversation * @param string $defaultChatServiceRoleSid The service role assigned to users * when they are added to the service * @param bool $reachabilityEnabled Whether the Reachability Indicator feature * is enabled for this Conversations Service * @return UpdateConfigurationOptions Options builder */ public static function update(string $defaultConversationCreatorRoleSid = Values::NONE, string $defaultConversationRoleSid = Values::NONE, string $defaultChatServiceRoleSid = Values::NONE, bool $reachabilityEnabled = Values::NONE): UpdateConfigurationOptions { return new UpdateConfigurationOptions($defaultConversationCreatorRoleSid, $defaultConversationRoleSid, $defaultChatServiceRoleSid, $reachabilityEnabled); } } class UpdateConfigurationOptions extends Options { /** * @param string $defaultConversationCreatorRoleSid The role assigned to a * conversation creator when * they join a new conversation * @param string $defaultConversationRoleSid The role assigned to users when * they are added to a conversation * @param string $defaultChatServiceRoleSid The service role assigned to users * when they are added to the service * @param bool $reachabilityEnabled Whether the Reachability Indicator feature * is enabled for this Conversations Service */ public function __construct(string $defaultConversationCreatorRoleSid = Values::NONE, string $defaultConversationRoleSid = Values::NONE, string $defaultChatServiceRoleSid = Values::NONE, bool $reachabilityEnabled = Values::NONE) { $this->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 the [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. * * @param string $defaultConversationCreatorRoleSid The role assigned to a * conversation creator when * they join a new conversation * @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 the [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. * * @param string $defaultConversationRoleSid The role assigned to users when * they are added to a conversation * @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 the [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. * * @param string $defaultChatServiceRoleSid The service role assigned to users * when they are added to the service * @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/chat/reachability-indicator) is enabled for this Conversations Service. The default is `false`. * * @param bool $reachabilityEnabled Whether the Reachability Indicator feature * is enabled for this Conversations Service * @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 . ']'; } } Conversations/V1/Configuration/WebhookPage.php 0000644 00000002252 15107452336 0015411 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Configuration; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class WebhookPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Conversations/V1/Configuration/WebhookList.php 0000644 00000001627 15107452336 0015455 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Configuration; use Twilio\ListResource; use Twilio\Version; class WebhookList extends ListResource { /** * Construct the WebhookList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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]'; } } Conversations/V1/Configuration/WebhookContext.php 0000644 00000004310 15107452336 0016156 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Configuration; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class WebhookContext extends InstanceContext { /** * Initialize the WebhookContext * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Configuration/Webhooks'; } /** * Fetch the WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WebhookInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } Conversations/V1/Configuration/WebhookInstance.php 0000644 00000006625 15107452336 0016311 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Configuration; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $method * @property string[] $filters * @property string $preWebhookUrl * @property string $postWebhookUrl * @property string $target * @property string $url */ class WebhookInstance extends InstanceResource { /** * Initialize the WebhookInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Conversations/V1/Configuration/WebhookOptions.php 0000644 00000011274 15107452336 0016174 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Configuration; use Twilio\Options; use Twilio\Values; abstract class WebhookOptions { /** * @param string $method The HTTP method to be used when sending a webhook * request. * @param string[] $filters The list of webhook event triggers that are enabled * for this Service. * @param string $preWebhookUrl The absolute url the pre-event webhook request * should be sent to. * @param string $postWebhookUrl The absolute url the post-event webhook * request should be sent to. * @param string $target The routing target of the webhook. * @return UpdateWebhookOptions Options builder */ public static function update(string $method = Values::NONE, array $filters = Values::ARRAY_NONE, string $preWebhookUrl = Values::NONE, string $postWebhookUrl = Values::NONE, string $target = Values::NONE): UpdateWebhookOptions { return new UpdateWebhookOptions($method, $filters, $preWebhookUrl, $postWebhookUrl, $target); } } class UpdateWebhookOptions extends Options { /** * @param string $method The HTTP method to be used when sending a webhook * request. * @param string[] $filters The list of webhook event triggers that are enabled * for this Service. * @param string $preWebhookUrl The absolute url the pre-event webhook request * should be sent to. * @param string $postWebhookUrl The absolute url the post-event webhook * request should be sent to. * @param string $target The routing target of the webhook. */ public function __construct(string $method = Values::NONE, array $filters = Values::ARRAY_NONE, string $preWebhookUrl = Values::NONE, string $postWebhookUrl = Values::NONE, string $target = Values::NONE) { $this->options['method'] = $method; $this->options['filters'] = $filters; $this->options['preWebhookUrl'] = $preWebhookUrl; $this->options['postWebhookUrl'] = $postWebhookUrl; $this->options['target'] = $target; } /** * The HTTP method to be used when sending a webhook request. * * @param string $method The HTTP method to be used when sending a webhook * request. * @return $this Fluent Builder */ public function setMethod(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. * @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; } /** * The routing target of the webhook. * * @param string $target The routing target of the webhook. * @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 . ']'; } } Conversations/V1/ConversationOptions.php 0000644 00000045722 15107452336 0014446 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Options; use Twilio\Values; abstract class ConversationOptions { /** * @param string $friendlyName The human-readable name of this conversation. * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $messagingServiceSid The unique ID of the Messaging Service * this conversation belongs to. * @param string $attributes An optional string metadata field you can use to * store any data you wish. * @param string $state Current state of this conversation. * @param string $timersInactive ISO8601 duration when conversation will be * switched to `inactive` state. * @param string $timersClosed ISO8601 duration when conversation will be * switched to `closed` state. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return CreateConversationOptions Options builder */ public static function create(string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, string $messagingServiceSid = Values::NONE, string $attributes = Values::NONE, string $state = Values::NONE, string $timersInactive = Values::NONE, string $timersClosed = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE): CreateConversationOptions { return new CreateConversationOptions($friendlyName, $uniqueName, $dateCreated, $dateUpdated, $messagingServiceSid, $attributes, $state, $timersInactive, $timersClosed, $xTwilioWebhookEnabled); } /** * @param string $friendlyName The human-readable name of this conversation. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes An optional string metadata field you can use to * store any data you wish. * @param string $messagingServiceSid The unique ID of the Messaging Service * this conversation belongs to. * @param string $state Current state of this conversation. * @param string $timersInactive ISO8601 duration when conversation will be * switched to `inactive` state. * @param string $timersClosed ISO8601 duration when conversation will be * switched to `closed` state. * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return UpdateConversationOptions Options builder */ public static function update(string $friendlyName = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, 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 $xTwilioWebhookEnabled = Values::NONE): UpdateConversationOptions { return new UpdateConversationOptions($friendlyName, $dateCreated, $dateUpdated, $attributes, $messagingServiceSid, $state, $timersInactive, $timersClosed, $uniqueName, $xTwilioWebhookEnabled); } /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return DeleteConversationOptions Options builder */ public static function delete(string $xTwilioWebhookEnabled = Values::NONE): DeleteConversationOptions { return new DeleteConversationOptions($xTwilioWebhookEnabled); } } class CreateConversationOptions extends Options { /** * @param string $friendlyName The human-readable name of this conversation. * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $messagingServiceSid The unique ID of the Messaging Service * this conversation belongs to. * @param string $attributes An optional string metadata field you can use to * store any data you wish. * @param string $state Current state of this conversation. * @param string $timersInactive ISO8601 duration when conversation will be * switched to `inactive` state. * @param string $timersClosed ISO8601 duration when conversation will be * switched to `closed` state. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header */ public function __construct(string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, string $messagingServiceSid = Values::NONE, string $attributes = Values::NONE, string $state = Values::NONE, string $timersInactive = Values::NONE, string $timersClosed = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE) { $this->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['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The human-readable name of this conversation, limited to 256 characters. Optional. * * @param string $friendlyName The human-readable name of this conversation. * @return $this Fluent Builder */ public function setFriendlyName(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 * @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/sms/services/api) this conversation belongs to. * * @param string $messagingServiceSid The unique ID of the Messaging Service * 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. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * Current state of this conversation. Can be either `active`, `inactive` or `closed` and defaults to `active` * * @param string $state Current state of this conversation. * @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. * @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. * @return $this Fluent Builder */ public function setTimersClosed(string $timersClosed): self { $this->options['timersClosed'] = $timersClosed; 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 UpdateConversationOptions extends Options { /** * @param string $friendlyName The human-readable name of this conversation. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes An optional string metadata field you can use to * store any data you wish. * @param string $messagingServiceSid The unique ID of the Messaging Service * this conversation belongs to. * @param string $state Current state of this conversation. * @param string $timersInactive ISO8601 duration when conversation will be * switched to `inactive` state. * @param string $timersClosed ISO8601 duration when conversation will be * switched to `closed` state. * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header */ public function __construct(string $friendlyName = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, 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 $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['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The human-readable name of this conversation, limited to 256 characters. Optional. * * @param string $friendlyName The human-readable name of this conversation. * @return $this Fluent Builder */ public function setFriendlyName(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. * @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/sms/services/api) this conversation belongs to. * * @param string $messagingServiceSid The unique ID of the Messaging Service * this conversation belongs to. * @return $this Fluent Builder */ public function setMessagingServiceSid(string $messagingServiceSid): self { $this->options['messagingServiceSid'] = $messagingServiceSid; return $this; } /** * Current state of this conversation. Can be either `active`, `inactive` or `closed` and defaults to `active` * * @param string $state Current state of this conversation. * @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. * @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. * @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 * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; 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 . ']'; } } 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 . ']'; } } Conversations/V1/Conversation/WebhookPage.php 0000644 00000002314 15107452336 0015253 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class WebhookPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Conversations/V1/Conversation/ParticipantList.php 0000644 00000014355 15107452336 0016202 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ParticipantList extends ListResource { /** * Construct the ParticipantList * * @param Version $version Version that contains the resource * @param string $conversationSid The unique ID of the Conversation for this * participant. */ public function __construct(Version $version, string $conversationSid) { parent::__construct($version); // Path Solution $this->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(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled'], ]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new ParticipantInstance($this->version, $payload, $this->solution['conversationSid']); } /** * Streams ParticipantInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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]'; } } Conversations/V1/Conversation/WebhookList.php 0000644 00000014122 15107452336 0015312 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class WebhookList extends ListResource { /** * Construct the WebhookList * * @param Version $version Version that contains the resource * @param string $conversationSid The unique ID of the Conversation for this * webhook. */ public function __construct(Version $version, string $conversationSid) { parent::__construct($version); // Path Solution $this->solution = ['conversationSid' => $conversationSid, ]; $this->uri = '/Conversations/' . \rawurlencode($conversationSid) . '/Webhooks'; } /** * Streams WebhookInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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); } /** * Create the WebhookInstance * * @param string $target The target of this webhook. * @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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new WebhookInstance($this->version, $payload, $this->solution['conversationSid']); } /** * Constructs a WebhookContext * * @param string $sid A 34 character string that uniquely identifies this * resource. */ 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]'; } } Conversations/V1/Conversation/ParticipantInstance.php 0000644 00000011715 15107452337 0017031 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $conversationSid * @property string $sid * @property string $identity * @property string $attributes * @property array $messagingBinding * @property string $roleSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property int $lastReadMessageIndex * @property string $lastReadTimestamp */ class ParticipantInstance extends InstanceResource { /** * Initialize the ParticipantInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $conversationSid The unique ID of the Conversation for this * participant. * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function __construct(Version $version, array $payload, string $conversationSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Conversations/V1/Conversation/MessageOptions.php 0000644 00000036543 15107452337 0016034 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Options; use Twilio\Values; abstract class MessageOptions { /** * @param string $author The channel specific identifier of the message's * author. * @param string $body The content of the message. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes A string metadata field you can use to store any * data you wish. * @param string $mediaSid The Media SID to be attached to the new Message. * @param string $contentSid The unique ID of the multi-channel Rich Content * template. * @param string $contentVariables A structurally valid JSON string that * contains values to resolve Rich Content * template variables. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return CreateMessageOptions Options builder */ public static function create(string $author = Values::NONE, string $body = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, string $attributes = Values::NONE, string $mediaSid = Values::NONE, string $contentSid = Values::NONE, string $contentVariables = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE): CreateMessageOptions { return new CreateMessageOptions($author, $body, $dateCreated, $dateUpdated, $attributes, $mediaSid, $contentSid, $contentVariables, $xTwilioWebhookEnabled); } /** * @param string $author The channel specific identifier of the message's * author. * @param string $body The content of the message. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes A string metadata field you can use to store any * data you wish. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return UpdateMessageOptions Options builder */ public static function update(string $author = Values::NONE, string $body = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, string $attributes = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE): UpdateMessageOptions { return new UpdateMessageOptions($author, $body, $dateCreated, $dateUpdated, $attributes, $xTwilioWebhookEnabled); } /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return DeleteMessageOptions Options builder */ public static function delete(string $xTwilioWebhookEnabled = Values::NONE): DeleteMessageOptions { return new DeleteMessageOptions($xTwilioWebhookEnabled); } /** * @param string $order The sort order of the returned messages * @return ReadMessageOptions Options builder */ public static function read(string $order = Values::NONE): ReadMessageOptions { return new ReadMessageOptions($order); } } class CreateMessageOptions extends Options { /** * @param string $author The channel specific identifier of the message's * author. * @param string $body The content of the message. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes A string metadata field you can use to store any * data you wish. * @param string $mediaSid The Media SID to be attached to the new Message. * @param string $contentSid The unique ID of the multi-channel Rich Content * template. * @param string $contentVariables A structurally valid JSON string that * contains values to resolve Rich Content * template variables. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header */ public function __construct(string $author = Values::NONE, string $body = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, string $attributes = Values::NONE, string $mediaSid = Values::NONE, string $contentSid = Values::NONE, string $contentVariables = 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['mediaSid'] = $mediaSid; $this->options['contentSid'] = $contentSid; $this->options['contentVariables'] = $contentVariables; $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. * @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. * @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. * @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. * @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-api) 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 * template. * @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 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 UpdateMessageOptions extends Options { /** * @param string $author The channel specific identifier of the message's * author. * @param string $body The content of the message. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes A string metadata field you can use to store any * data you wish. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header */ public function __construct(string $author = Values::NONE, string $body = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, string $attributes = 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['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. * @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. * @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. * @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. * @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.Conversations.V1.UpdateMessageOptions ' . $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 */ 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 * @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 . ']'; } } Conversations/V1/Conversation/ParticipantContext.php 0000644 00000007473 15107452337 0016717 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class ParticipantContext extends InstanceContext { /** * Initialize the ParticipantContext * * @param Version $version Version that contains the resource * @param string $conversationSid The unique ID of the Conversation for this * participant. * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function __construct(Version $version, $conversationSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['conversationSid' => $conversationSid, 'sid' => $sid, ]; $this->uri = '/Conversations/' . \rawurlencode($conversationSid) . '/Participants/' . \rawurlencode($sid) . ''; } /** * Update the ParticipantInstance * * @param array|Options $options Optional Arguments * @return ParticipantInstance Updated ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function update(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(['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'] ); } /** * 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(['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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Conversations/V1/Conversation/MessagePage.php 0000644 00000002314 15107452337 0015242 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MessagePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Conversations/V1/Conversation/MessageList.php 0000644 00000014622 15107452337 0015306 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class MessageList extends ListResource { /** * Construct the MessageList * * @param Version $version Version that contains the resource * @param string $conversationSid The unique ID of the Conversation for this * message. */ public function __construct(Version $version, string $conversationSid) { parent::__construct($version); // Path Solution $this->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'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled'], ]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new MessageInstance($this->version, $payload, $this->solution['conversationSid']); } /** * Streams MessageInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will 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']); } /** * 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); } /** * Retrieve a single page of MessageInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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]'; } } Conversations/V1/Conversation/WebhookContext.php 0000644 00000006346 15107452337 0016035 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class WebhookContext extends InstanceContext { /** * Initialize the WebhookContext * * @param Version $version Version that contains the resource * @param string $conversationSid The unique ID of the Conversation for this * webhook. * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function __construct(Version $version, $conversationSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['conversationSid' => $conversationSid, 'sid' => $sid, ]; $this->uri = '/Conversations/' . \rawurlencode($conversationSid) . '/Webhooks/' . \rawurlencode($sid) . ''; } /** * Fetch the WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WebhookInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new WebhookInstance( $this->version, $payload, $this->solution['conversationSid'], $this->solution['sid'] ); } /** * Delete the WebhookInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Conversations/V1/Conversation/ParticipantOptions.php 0000644 00000052363 15107452337 0016724 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Options; use Twilio\Values; abstract class ParticipantOptions { /** * @param string $identity A unique string identifier for the conversation * participant as Conversation User. * @param string $messagingBindingAddress The address of the participant's * device. * @param string $messagingBindingProxyAddress The address of the Twilio phone * number that the participant is * in contact with. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes An optional string metadata field you can use to * store any data you wish. * @param string $messagingBindingProjectedAddress The address of the Twilio * phone number that is used in * Group MMS. * @param string $roleSid The SID of a conversation-level Role to assign to the * participant * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return CreateParticipantOptions Options builder */ public static function create(string $identity = Values::NONE, string $messagingBindingAddress = Values::NONE, string $messagingBindingProxyAddress = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, string $attributes = Values::NONE, string $messagingBindingProjectedAddress = Values::NONE, string $roleSid = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE): CreateParticipantOptions { return new CreateParticipantOptions($identity, $messagingBindingAddress, $messagingBindingProxyAddress, $dateCreated, $dateUpdated, $attributes, $messagingBindingProjectedAddress, $roleSid, $xTwilioWebhookEnabled); } /** * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes An optional string metadata field you can use to * store any data you wish. * @param string $roleSid The SID of a conversation-level Role to assign to the * participant * @param string $messagingBindingProxyAddress The address of the Twilio phone * number that the participant is * in contact with. * @param string $messagingBindingProjectedAddress The address of the Twilio * phone number that is used in * Group MMS. * @param string $identity A unique string identifier for the conversation * participant as Conversation User. * @param int $lastReadMessageIndex Index of last “read” message in the * Conversation for the Participant. * @param string $lastReadTimestamp Timestamp of last “read” message in the * Conversation for the Participant. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return UpdateParticipantOptions Options builder */ public static function update(\DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, string $attributes = Values::NONE, string $roleSid = Values::NONE, string $messagingBindingProxyAddress = Values::NONE, string $messagingBindingProjectedAddress = Values::NONE, string $identity = Values::NONE, int $lastReadMessageIndex = Values::NONE, string $lastReadTimestamp = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE): UpdateParticipantOptions { return new UpdateParticipantOptions($dateCreated, $dateUpdated, $attributes, $roleSid, $messagingBindingProxyAddress, $messagingBindingProjectedAddress, $identity, $lastReadMessageIndex, $lastReadTimestamp, $xTwilioWebhookEnabled); } /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return DeleteParticipantOptions Options builder */ public static function delete(string $xTwilioWebhookEnabled = Values::NONE): DeleteParticipantOptions { return new DeleteParticipantOptions($xTwilioWebhookEnabled); } } class CreateParticipantOptions extends Options { /** * @param string $identity A unique string identifier for the conversation * participant as Conversation User. * @param string $messagingBindingAddress The address of the participant's * device. * @param string $messagingBindingProxyAddress The address of the Twilio phone * number that the participant is * in contact with. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes An optional string metadata field you can use to * store any data you wish. * @param string $messagingBindingProjectedAddress The address of the Twilio * phone number that is used in * Group MMS. * @param string $roleSid The SID of a conversation-level Role to assign to the * participant * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header */ public function __construct(string $identity = Values::NONE, string $messagingBindingAddress = Values::NONE, string $messagingBindingProxyAddress = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, string $attributes = Values::NONE, string $messagingBindingProjectedAddress = Values::NONE, string $roleSid = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE) { $this->options['identity'] = $identity; $this->options['messagingBindingAddress'] = $messagingBindingAddress; $this->options['messagingBindingProxyAddress'] = $messagingBindingProxyAddress; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; $this->options['messagingBindingProjectedAddress'] = $messagingBindingProjectedAddress; $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. * @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. * @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 that the participant is * in contact with. * @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. * @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. * @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 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 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. * @param string $roleSid The SID of a conversation-level Role to assign to the * participant * @param string $messagingBindingProxyAddress The address of the Twilio phone * number that the participant is * in contact with. * @param string $messagingBindingProjectedAddress The address of the Twilio * phone number that is used in * Group MMS. * @param string $identity A unique string identifier for the conversation * participant as Conversation User. * @param int $lastReadMessageIndex Index of last “read” message in the * Conversation for the Participant. * @param string $lastReadTimestamp Timestamp of last “read” message in the * Conversation for the Participant. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header */ public function __construct(\DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, string $attributes = Values::NONE, string $roleSid = Values::NONE, string $messagingBindingProxyAddress = Values::NONE, string $messagingBindingProjectedAddress = Values::NONE, string $identity = Values::NONE, int $lastReadMessageIndex = Values::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. * @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 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. * @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. * @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. * @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 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 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 . ']'; } } 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 . ']'; } } Conversations/V1/Conversation/MessageContext.php 0000644 00000012354 15107452337 0016017 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Conversations\V1\Conversation\Message\DeliveryReceiptList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property DeliveryReceiptList $deliveryReceipts * @method \Twilio\Rest\Conversations\V1\Conversation\Message\DeliveryReceiptContext deliveryReceipts(string $sid) */ class MessageContext extends InstanceContext { protected $_deliveryReceipts; /** * Initialize the MessageContext * * @param Version $version Version that contains the resource * @param string $conversationSid The unique ID of the Conversation for this * message. * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function __construct(Version $version, $conversationSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['conversationSid' => $conversationSid, 'sid' => $sid, ]; $this->uri = '/Conversations/' . \rawurlencode($conversationSid) . '/Messages/' . \rawurlencode($sid) . ''; } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update(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'], ]); $headers = Values::of(['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'] ); } /** * 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(['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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Conversations/V1/Conversation/MessageInstance.php 0000644 00000012533 15107452337 0016136 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Conversations\V1\Conversation\Message\DeliveryReceiptList; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $conversationSid * @property string $sid * @property int $index * @property string $author * @property string $body * @property array[] $media * @property string $attributes * @property string $participantSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $delivery * @property array $links * @property string $contentSid */ class MessageInstance extends InstanceResource { protected $_deliveryReceipts; /** * Initialize the MessageInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $conversationSid The unique ID of the Conversation for this * message. * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function __construct(Version $version, array $payload, string $conversationSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * 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) . ']'; } } Conversations/V1/Conversation/ParticipantPage.php 0000644 00000002344 15107452337 0016137 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ParticipantPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Conversations/V1/Conversation/WebhookInstance.php 0000644 00000010535 15107452337 0016150 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $conversationSid * @property string $target * @property string $url * @property array $configuration * @property \DateTime $dateCreated * @property \DateTime $dateUpdated */ class WebhookInstance extends InstanceResource { /** * Initialize the WebhookInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $conversationSid The unique ID of the Conversation for this * webhook. * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function __construct(Version $version, array $payload, string $conversationSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Conversations/V1/Conversation/WebhookOptions.php 0000644 00000027045 15107452337 0016043 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Options; use Twilio\Values; abstract class WebhookOptions { /** * @param string $configurationUrl The absolute url the webhook request should * be sent to. * @param string $configurationMethod The HTTP method to be used when sending a * webhook request. * @param string[] $configurationFilters The list of events, firing webhook * event for this Conversation. * @param string[] $configurationTriggers The list of keywords, firing webhook * event for this Conversation. * @param string $configurationFlowSid The studio flow SID, where the webhook * should be sent to. * @param int $configurationReplayAfter The message index for which and it's * successors the webhook will be replayed. * @return CreateWebhookOptions Options builder */ public static function create(string $configurationUrl = Values::NONE, string $configurationMethod = Values::NONE, array $configurationFilters = Values::ARRAY_NONE, array $configurationTriggers = Values::ARRAY_NONE, string $configurationFlowSid = Values::NONE, int $configurationReplayAfter = Values::NONE): CreateWebhookOptions { return new CreateWebhookOptions($configurationUrl, $configurationMethod, $configurationFilters, $configurationTriggers, $configurationFlowSid, $configurationReplayAfter); } /** * @param string $configurationUrl The absolute url the webhook request should * be sent to. * @param string $configurationMethod The HTTP method to be used when sending a * webhook request. * @param string[] $configurationFilters The list of events, firing webhook * event for this Conversation. * @param string[] $configurationTriggers The list of keywords, firing webhook * event for this Conversation. * @param string $configurationFlowSid The studio flow SID, where the webhook * should be sent to. * @return UpdateWebhookOptions Options builder */ public static function update(string $configurationUrl = Values::NONE, string $configurationMethod = Values::NONE, array $configurationFilters = Values::ARRAY_NONE, array $configurationTriggers = Values::ARRAY_NONE, string $configurationFlowSid = Values::NONE): UpdateWebhookOptions { return new UpdateWebhookOptions($configurationUrl, $configurationMethod, $configurationFilters, $configurationTriggers, $configurationFlowSid); } } class CreateWebhookOptions extends Options { /** * @param string $configurationUrl The absolute url the webhook request should * be sent to. * @param string $configurationMethod The HTTP method to be used when sending a * webhook request. * @param string[] $configurationFilters The list of events, firing webhook * event for this Conversation. * @param string[] $configurationTriggers The list of keywords, firing webhook * event for this Conversation. * @param string $configurationFlowSid The studio flow SID, where the webhook * should be sent to. * @param int $configurationReplayAfter The message index for which and it's * successors the webhook will be replayed. */ public function __construct(string $configurationUrl = Values::NONE, string $configurationMethod = Values::NONE, array $configurationFilters = Values::ARRAY_NONE, array $configurationTriggers = Values::ARRAY_NONE, string $configurationFlowSid = Values::NONE, int $configurationReplayAfter = Values::NONE) { $this->options['configurationUrl'] = $configurationUrl; $this->options['configurationMethod'] = $configurationMethod; $this->options['configurationFilters'] = $configurationFilters; $this->options['configurationTriggers'] = $configurationTriggers; $this->options['configurationFlowSid'] = $configurationFlowSid; $this->options['configurationReplayAfter'] = $configurationReplayAfter; } /** * The absolute url the webhook request should be sent to. * * @param string $configurationUrl The absolute url the webhook request should * be sent to. * @return $this Fluent Builder */ public function setConfigurationUrl(string $configurationUrl): self { $this->options['configurationUrl'] = $configurationUrl; return $this; } /** * The HTTP method to be used when sending a webhook request. * * @param string $configurationMethod The HTTP method to be used when sending a * webhook request. * @return $this Fluent Builder */ public function setConfigurationMethod(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. * @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 The HTTP method to be used when sending a * webhook request. * @param string[] $configurationFilters The list of events, firing webhook * event for this Conversation. * @param string[] $configurationTriggers The list of keywords, firing webhook * event for this Conversation. * @param string $configurationFlowSid The studio flow SID, where the webhook * should be sent to. */ public function __construct(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; } /** * The HTTP method to be used when sending a webhook request. * * @param string $configurationMethod The HTTP method to be used when sending a * webhook request. * @return $this Fluent Builder */ public function setConfigurationMethod(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 . ']'; } } Conversations/V1/Conversation/Message/DeliveryReceiptContext.php 0000644 00000004336 15107452337 0021117 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Conversation\Message; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class DeliveryReceiptContext extends InstanceContext { /** * Initialize the DeliveryReceiptContext * * @param Version $version Version that contains the resource * @param string $conversationSid The unique ID of the Conversation for this * delivery receipt. * @param string $messageSid The SID of the message the delivery receipt * belongs to. * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function __construct(Version $version, $conversationSid, $messageSid, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Conversations/V1/Conversation/Message/DeliveryReceiptList.php 0000644 00000012451 15107452337 0020403 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Conversation\Message; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class DeliveryReceiptList extends ListResource { /** * Construct the DeliveryReceiptList * * @param Version $version Version that contains the resource * @param string $conversationSid The unique ID of the Conversation for this * message. * @param string $messageSid The SID of the message the delivery receipt * belongs to */ public function __construct(Version $version, string $conversationSid, string $messageSid) { parent::__construct($version); // Path Solution $this->solution = ['conversationSid' => $conversationSid, 'messageSid' => $messageSid, ]; $this->uri = '/Conversations/' . \rawurlencode($conversationSid) . '/Messages/' . \rawurlencode($messageSid) . '/Receipts'; } /** * 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']); } /** * 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); } /** * 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]'; } } Conversations/V1/Conversation/Message/DeliveryReceiptInstance.php 0000644 00000010571 15107452337 0021235 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Conversation\Message; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $conversationSid * @property string $sid * @property string $messageSid * @property string $channelMessageSid * @property string $participantSid * @property string $status * @property int $errorCode * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class DeliveryReceiptInstance extends InstanceResource { /** * Initialize the DeliveryReceiptInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $conversationSid The unique ID of the Conversation for this * message. * @param string $messageSid The SID of the message the delivery receipt * belongs to * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function __construct(Version $version, array $payload, string $conversationSid, string $messageSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Conversations/V1/Conversation/Message/DeliveryReceiptPage.php 0000644 00000002545 15107452337 0020347 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Conversation\Message; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class DeliveryReceiptPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Conversations/V1/ConfigurationList.php 0000644 00000005034 15107452337 0014054 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Conversations\V1\Configuration\WebhookList; use Twilio\Version; /** * @property WebhookList $webhooks * @method \Twilio\Rest\Conversations\V1\Configuration\WebhookContext webhooks() */ class ConfigurationList extends ListResource { protected $_webhooks = null; /** * Construct the ConfigurationList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; } /** * Access the webhooks */ protected function getWebhooks(): WebhookList { if (!$this->_webhooks) { $this->_webhooks = new WebhookList($this->version); } return $this->_webhooks; } /** * Constructs a ConfigurationContext */ public function getContext(): ConfigurationContext { return new ConfigurationContext($this->version); } /** * 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]'; } } Conversations/V1/ParticipantConversationList.php 0000644 00000011762 15107452337 0016123 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ParticipantConversationList extends ListResource { /** * Construct the ParticipantConversationList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/ParticipantConversations'; } /** * 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']); } /** * 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); } /** * Retrieve a single page of ParticipantConversationInstance records from the * API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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]'; } } Conversations/V1/ConfigurationContext.php 0000644 00000004352 15107452337 0014567 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class ConfigurationContext extends InstanceContext { /** * Initialize the ConfigurationContext * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Configuration'; } /** * Fetch the ConfigurationInstance * * @return ConfigurationInstance Fetched ConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ConfigurationInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } Conversations/V1/AddressConfigurationContext.php 0000644 00000006424 15107452337 0016077 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class AddressConfigurationContext extends InstanceContext { /** * Initialize the AddressConfigurationContext * * @param Version $version Version that contains the resource * @param string $sid The SID or Address of the Configuration. */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Configuration/Addresses/' . \rawurlencode($sid) . ''; } /** * Fetch the AddressConfigurationInstance * * @return AddressConfigurationInstance Fetched AddressConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AddressConfigurationInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new AddressConfigurationInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the AddressConfigurationInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Conversations/V1/ServiceInstance.php 0000644 00000011725 15107452337 0013502 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Rest\Conversations\V1\Service\BindingList; use Twilio\Rest\Conversations\V1\Service\ConfigurationList; use Twilio\Rest\Conversations\V1\Service\ConversationList; use Twilio\Rest\Conversations\V1\Service\ParticipantConversationList; use Twilio\Rest\Conversations\V1\Service\RoleList; use Twilio\Rest\Conversations\V1\Service\UserList; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $sid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class ServiceInstance extends InstanceResource { protected $_conversations; protected $_bindings; protected $_users; protected $_roles; protected $_configuration; protected $_participantConversations; /** * Initialize the ServiceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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 conversations */ protected function getConversations(): ConversationList { return $this->proxy()->conversations; } /** * Access the bindings */ protected function getBindings(): BindingList { return $this->proxy()->bindings; } /** * Access the users */ protected function getUsers(): UserList { return $this->proxy()->users; } /** * Access the roles */ protected function getRoles(): RoleList { return $this->proxy()->roles; } /** * Access the configuration */ protected function getConfiguration(): ConfigurationList { return $this->proxy()->configuration; } /** * Access the participantConversations */ protected function getParticipantConversations(): ParticipantConversationList { return $this->proxy()->participantConversations; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Conversations/V1/ConfigurationPage.php 0000644 00000002262 15107452337 0014015 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ConfigurationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Conversations/V1/ConfigurationInstance.php 0000644 00000007150 15107452337 0014706 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $defaultChatServiceSid * @property string $defaultMessagingServiceSid * @property string $defaultInactiveTimer * @property string $defaultClosedTimer * @property string $url * @property array $links */ class ConfigurationInstance extends InstanceResource { /** * Initialize the ConfigurationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Conversations/V1/ServiceList.php 0000644 00000012146 15107452337 0012647 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ServiceList extends ListResource { /** * Construct the ServiceList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Services'; } /** * Create the ServiceInstance * * @param string $friendlyName The human-readable name of this service. * @return ServiceInstance Created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName): ServiceInstance { $data = Values::of(['FriendlyName' => $friendlyName, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ServiceInstance($this->version, $payload); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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]'; } } Conversations/V1/ServiceContext.php 0000644 00000013531 15107452337 0013357 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Conversations\V1\Service\BindingList; use Twilio\Rest\Conversations\V1\Service\ConfigurationList; use Twilio\Rest\Conversations\V1\Service\ConversationList; use Twilio\Rest\Conversations\V1\Service\ParticipantConversationList; use Twilio\Rest\Conversations\V1\Service\RoleList; use Twilio\Rest\Conversations\V1\Service\UserList; use Twilio\Values; use Twilio\Version; /** * @property ConversationList $conversations * @property BindingList $bindings * @property UserList $users * @property RoleList $roles * @property ConfigurationList $configuration * @property ParticipantConversationList $participantConversations * @method \Twilio\Rest\Conversations\V1\Service\ConversationContext conversations(string $sid) * @method \Twilio\Rest\Conversations\V1\Service\BindingContext bindings(string $sid) * @method \Twilio\Rest\Conversations\V1\Service\UserContext users(string $sid) * @method \Twilio\Rest\Conversations\V1\Service\RoleContext roles(string $sid) * @method \Twilio\Rest\Conversations\V1\Service\ConfigurationContext configuration() */ class ServiceContext extends InstanceContext { protected $_conversations; protected $_bindings; protected $_users; protected $_roles; protected $_configuration; protected $_participantConversations; /** * Initialize the ServiceContext * * @param Version $version Version that contains the resource * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->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 { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { $payload = $this->version->fetch('GET', $this->uri); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Access the conversations */ protected function getConversations(): ConversationList { if (!$this->_conversations) { $this->_conversations = new ConversationList($this->version, $this->solution['sid']); } return $this->_conversations; } /** * Access the bindings */ protected function getBindings(): BindingList { if (!$this->_bindings) { $this->_bindings = new BindingList($this->version, $this->solution['sid']); } return $this->_bindings; } /** * Access the users */ protected function getUsers(): UserList { if (!$this->_users) { $this->_users = new UserList($this->version, $this->solution['sid']); } return $this->_users; } /** * 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; } /** * Access the participantConversations */ protected function getParticipantConversations(): ParticipantConversationList { if (!$this->_participantConversations) { $this->_participantConversations = new ParticipantConversationList( $this->version, $this->solution['sid'] ); } return $this->_participantConversations; } /** * 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) . ']'; } } Conversations/V1/ConversationInstance.php 0000644 00000012723 15107452337 0014553 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Conversations\V1\Conversation\MessageList; use Twilio\Rest\Conversations\V1\Conversation\ParticipantList; use Twilio\Rest\Conversations\V1\Conversation\WebhookList; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $chatServiceSid * @property string $messagingServiceSid * @property string $sid * @property string $friendlyName * @property string $uniqueName * @property string $attributes * @property string $state * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property array $timers * @property string $url * @property array $links * @property array $bindings */ class ConversationInstance extends InstanceResource { protected $_participants; protected $_messages; protected $_webhooks; /** * Initialize the ConversationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Access the participants */ protected function getParticipants(): ParticipantList { return $this->proxy()->participants; } /** * Access the messages */ protected function getMessages(): MessageList { return $this->proxy()->messages; } /** * Access the webhooks */ protected function getWebhooks(): WebhookList { return $this->proxy()->webhooks; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Conversations/V1/ConversationPage.php 0000644 00000002254 15107452337 0013661 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ConversationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Conversations/V1/CredentialContext.php 0000644 00000005410 15107452337 0014026 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class CredentialContext extends InstanceContext { /** * Initialize the CredentialContext * * @param Version $version Version that contains the resource * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Credentials/' . \rawurlencode($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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new CredentialInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the CredentialInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the CredentialInstance * * @return CredentialInstance Fetched CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialInstance { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Conversations/V1/UserContext.php 0000644 00000010704 15107452337 0012674 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Conversations\V1\User\UserConversationList; use Twilio\Values; use Twilio\Version; /** * @property UserConversationList $userConversations * @method \Twilio\Rest\Conversations\V1\User\UserConversationContext userConversations(string $conversationSid) */ class UserContext extends InstanceContext { protected $_userConversations; /** * Initialize the UserContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the User resource to fetch */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Users/' . \rawurlencode($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(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled'], ]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new UserInstance($this->version, $payload, $this->solution['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(['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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Conversations/V1/AddressConfigurationInstance.php 0000644 00000010446 15107452337 0016216 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $type * @property string $address * @property string $friendlyName * @property array $autoCreation * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class AddressConfigurationInstance extends InstanceResource { /** * Initialize the AddressConfigurationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID or Address of the Configuration. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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'), ]; $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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Conversations/V1/ParticipantConversationInstance.php 0000644 00000007211 15107452337 0016746 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $chatServiceSid * @property string $participantSid * @property string $participantUserSid * @property string $participantIdentity * @property array $participantMessagingBinding * @property string $conversationSid * @property string $conversationUniqueName * @property string $conversationFriendlyName * @property string $conversationAttributes * @property \DateTime $conversationDateCreated * @property \DateTime $conversationDateUpdated * @property string $conversationCreatedBy * @property string $conversationState * @property array $conversationTimers * @property array $links */ class ParticipantConversationInstance extends InstanceResource { /** * Initialize the ParticipantConversationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Conversations/V1/ConversationList.php 0000644 00000013642 15107452337 0013723 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ConversationList extends ListResource { /** * Construct the ConversationList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled'], ]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new ConversationInstance($this->version, $payload); } /** * Streams ConversationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * Reads ConversationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ConversationInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of ConversationInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ConversationPage Page of ConversationInstance */ public function page($pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): ConversationPage { $params = Values::of(['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. */ 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]'; } } Conversations/V1/AddressConfigurationPage.php 0000644 00000002334 15107452337 0015323 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AddressConfigurationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Conversations/V1/User/UserConversationInstance.php 0000644 00000013035 15107452337 0016325 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\User; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $chatServiceSid * @property string $conversationSid * @property int $unreadMessagesCount * @property int $lastReadMessageIndex * @property string $participantSid * @property string $userSid * @property string $friendlyName * @property string $conversationState * @property array $timers * @property string $attributes * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $createdBy * @property string $notificationLevel * @property string $uniqueName * @property string $url * @property array $links */ class UserConversationInstance extends InstanceResource { /** * Initialize the UserConversationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $userSid The unique ID for the User. * @param string $conversationSid The unique SID identifier of the Conversation. */ public function __construct(Version $version, array $payload, string $userSid, string $conversationSid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Conversations/V1/User/UserConversationPage.php 0000644 00000002352 15107452337 0015435 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\User; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UserConversationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Conversations/V1/User/UserConversationOptions.php 0000644 00000006576 15107452337 0016230 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\User; use Twilio\Options; use Twilio\Values; abstract class UserConversationOptions { /** * @param string $notificationLevel The Notification Level of this User * Conversation. * @param \DateTime $lastReadTimestamp The date of the last message read in * conversation by the user. * @param int $lastReadMessageIndex The index of the last read Message. * @return UpdateUserConversationOptions Options builder */ public static function update(string $notificationLevel = Values::NONE, \DateTime $lastReadTimestamp = Values::NONE, int $lastReadMessageIndex = Values::NONE): UpdateUserConversationOptions { return new UpdateUserConversationOptions($notificationLevel, $lastReadTimestamp, $lastReadMessageIndex); } } class UpdateUserConversationOptions extends Options { /** * @param string $notificationLevel The Notification Level of this User * Conversation. * @param \DateTime $lastReadTimestamp The date of the last message read in * conversation by the user. * @param int $lastReadMessageIndex The index of the last read Message. */ public function __construct(string $notificationLevel = Values::NONE, \DateTime $lastReadTimestamp = Values::NONE, int $lastReadMessageIndex = Values::NONE) { $this->options['notificationLevel'] = $notificationLevel; $this->options['lastReadTimestamp'] = $lastReadTimestamp; $this->options['lastReadMessageIndex'] = $lastReadMessageIndex; } /** * The Notification Level of this User Conversation. One of `default` or `muted`. * * @param string $notificationLevel The Notification Level of this User * Conversation. * @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. * @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 read Message. * @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 . ']'; } } Conversations/V1/User/UserConversationContext.php 0000644 00000006102 15107452337 0016202 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\User; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class UserConversationContext extends InstanceContext { /** * Initialize the UserConversationContext * * @param Version $version Version that contains the resource * @param string $userSid The unique SID identifier of the User. * @param string $conversationSid The unique SID identifier of the Conversation. */ public function __construct(Version $version, $userSid, $conversationSid) { parent::__construct($version); // Path Solution $this->solution = ['userSid' => $userSid, 'conversationSid' => $conversationSid, ]; $this->uri = '/Users/' . \rawurlencode($userSid) . '/Conversations/' . \rawurlencode($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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new UserConversationInstance( $this->version, $payload, $this->solution['userSid'], $this->solution['conversationSid'] ); } /** * Delete the UserConversationInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the UserConversationInstance * * @return UserConversationInstance Fetched UserConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserConversationInstance { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Conversations/V1/User/UserConversationList.php 0000644 00000011607 15107452337 0015477 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\User; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class UserConversationList extends ListResource { /** * Construct the UserConversationList * * @param Version $version Version that contains the resource * @param string $userSid The unique ID for the User. */ public function __construct(Version $version, string $userSid) { parent::__construct($version); // Path Solution $this->solution = ['userSid' => $userSid, ]; $this->uri = '/Users/' . \rawurlencode($userSid) . '/Conversations'; } /** * 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']); } /** * 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); } /** * 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. */ 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]'; } } Conversations/V1/UserPage.php 0000644 00000002174 15107452337 0012126 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UserPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Conversations/V1/RolePage.php 0000644 00000002174 15107452337 0012111 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RolePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Conversations/V1/CredentialList.php 0000644 00000013272 15107452337 0013322 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class CredentialList extends ListResource { /** * Construct the CredentialList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Credentials'; } /** * Create the CredentialInstance * * @param string $type The type of push-notification service the credential is * for. * @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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CredentialInstance($this->version, $payload); } /** * 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']); } /** * 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); } /** * 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]'; } } Conversations/V1/AddressConfigurationList.php 0000644 00000015412 15107452337 0015363 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class AddressConfigurationList extends ListResource { /** * Construct the AddressConfigurationList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Configuration/Addresses'; } /** * 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']); } /** * 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); } /** * Retrieve a single page of AddressConfigurationInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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); } /** * Create the AddressConfigurationInstance * * @param string $type Type of Address. * @param string $address The unique address to be configured. * @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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AddressConfigurationInstance($this->version, $payload); } /** * Constructs a AddressConfigurationContext * * @param string $sid The SID or 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]'; } } Conversations/V1/CredentialInstance.php 0000644 00000010035 15107452337 0014145 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $friendlyName * @property string $type * @property string $sandbox * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class CredentialInstance extends InstanceResource { /** * Initialize the CredentialInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Conversations/V1/RoleList.php 0000644 00000012426 15107452337 0012151 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class RoleList extends ListResource { /** * Construct the RoleList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Roles'; } /** * Create the RoleInstance * * @param string $friendlyName A string to describe the new resource * @param string $type The type of role * @param string[] $permission A permission the role should have * @return RoleInstance 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; }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new RoleInstance($this->version, $payload); } /** * 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']); } /** * 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); } /** * 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 fetch */ 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]'; } } Conversations/V1/AddressConfigurationOptions.php 0000644 00000052627 15107452337 0016114 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Options; use Twilio\Values; abstract class AddressConfigurationOptions { /** * @param string $type The type of address configuration. * @return ReadAddressConfigurationOptions Options builder */ public static function read(string $type = Values::NONE): ReadAddressConfigurationOptions { return new ReadAddressConfigurationOptions($type); } /** * @param string $friendlyName The human-readable name of this configuration. * @param bool $autoCreationEnabled Enable/Disable auto-creating conversations * for messages to this address * @param string $autoCreationType Type of Auto Creation. * @param string $autoCreationConversationServiceSid Conversation Service for * the auto-created * conversation. * @param string $autoCreationWebhookUrl For type `webhook`, the url for the * webhook request. * @param string $autoCreationWebhookMethod For type `webhook`, the HTTP method * to be used when sending a webhook * request. * @param string[] $autoCreationWebhookFilters The list of events, firing * webhook event for this * Conversation. * @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 * @return CreateAddressConfigurationOptions Options builder */ public static function create(string $friendlyName = Values::NONE, bool $autoCreationEnabled = Values::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::NONE): CreateAddressConfigurationOptions { return new CreateAddressConfigurationOptions($friendlyName, $autoCreationEnabled, $autoCreationType, $autoCreationConversationServiceSid, $autoCreationWebhookUrl, $autoCreationWebhookMethod, $autoCreationWebhookFilters, $autoCreationStudioFlowSid, $autoCreationStudioRetryCount); } /** * @param string $friendlyName The human-readable name of this configuration. * @param bool $autoCreationEnabled Enable/Disable auto-creating conversations * for messages to this address * @param string $autoCreationType Type of Auto Creation. * @param string $autoCreationConversationServiceSid Conversation Service for * the auto-created * conversation. * @param string $autoCreationWebhookUrl For type `webhook`, the url for the * webhook request. * @param string $autoCreationWebhookMethod For type `webhook`, the HTTP method * to be used when sending a webhook * request. * @param string[] $autoCreationWebhookFilters The list of events, firing * webhook event for this * Conversation. * @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 * @return UpdateAddressConfigurationOptions Options builder */ public static function update(string $friendlyName = Values::NONE, bool $autoCreationEnabled = Values::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::NONE): UpdateAddressConfigurationOptions { return new UpdateAddressConfigurationOptions($friendlyName, $autoCreationEnabled, $autoCreationType, $autoCreationConversationServiceSid, $autoCreationWebhookUrl, $autoCreationWebhookMethod, $autoCreationWebhookFilters, $autoCreationStudioFlowSid, $autoCreationStudioRetryCount); } } class ReadAddressConfigurationOptions extends Options { /** * @param string $type The type of address configuration. */ 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 The type of address configuration. * @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 CreateAddressConfigurationOptions extends Options { /** * @param string $friendlyName The human-readable name of this configuration. * @param bool $autoCreationEnabled Enable/Disable auto-creating conversations * for messages to this address * @param string $autoCreationType Type of Auto Creation. * @param string $autoCreationConversationServiceSid Conversation Service for * the auto-created * conversation. * @param string $autoCreationWebhookUrl For type `webhook`, the url for the * webhook request. * @param string $autoCreationWebhookMethod For type `webhook`, the HTTP method * to be used when sending a webhook * request. * @param string[] $autoCreationWebhookFilters The list of events, firing * webhook event for this * Conversation. * @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::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::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. * @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; } /** * Type of Auto Creation. Value can be one of `webhook`, `studio` or `default`. * * @param string $autoCreationType Type of Auto Creation. * @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. * @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; } /** * For type `webhook`, the HTTP method to be used when sending a webhook request. * * @param string $autoCreationWebhookMethod For type `webhook`, the HTTP method * to be used when sending a webhook * request. * @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. * @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.CreateAddressConfigurationOptions ' . $options . ']'; } } class UpdateAddressConfigurationOptions extends Options { /** * @param string $friendlyName The human-readable name of this configuration. * @param bool $autoCreationEnabled Enable/Disable auto-creating conversations * for messages to this address * @param string $autoCreationType Type of Auto Creation. * @param string $autoCreationConversationServiceSid Conversation Service for * the auto-created * conversation. * @param string $autoCreationWebhookUrl For type `webhook`, the url for the * webhook request. * @param string $autoCreationWebhookMethod For type `webhook`, the HTTP method * to be used when sending a webhook * request. * @param string[] $autoCreationWebhookFilters The list of events, firing * webhook event for this * Conversation. * @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::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::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. * @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; } /** * Type of Auto Creation. Value can be one of `webhook`, `studio` or `default`. * * @param string $autoCreationType Type of Auto Creation. * @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. * @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; } /** * For type `webhook`, the HTTP method to be used when sending a webhook request. * * @param string $autoCreationWebhookMethod For type `webhook`, the HTTP method * to be used when sending a webhook * request. * @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. * @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 . ']'; } } Conversations/V1/ServicePage.php 0000644 00000002216 15107452337 0012605 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ServicePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Conversations/V1/UserList.php 0000644 00000012607 15107452337 0012167 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class UserList extends ListResource { /** * Construct the UserList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Users'; } /** * Create the UserInstance * * @param string $identity The string that identifies the resource's User * @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(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled'], ]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new UserInstance($this->version, $payload); } /** * 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']); } /** * 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); } /** * 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 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.Conversations.V1.UserList]'; } } Conversations/V1/RoleContext.php 0000644 00000004436 15107452337 0012664 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class RoleContext extends InstanceContext { /** * Initialize the RoleContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the Role resource to fetch */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Roles/' . \rawurlencode($sid) . ''; } /** * Update the RoleInstance * * @param string[] $permission A permission the role should have * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $permission): RoleInstance { $data = Values::of(['Permission' => Serialize::map($permission, function($e) { return $e; }), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new RoleInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the RoleInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the RoleInstance * * @return RoleInstance Fetched RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RoleInstance { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Conversations/V1/RoleInstance.php 0000644 00000010010 15107452337 0012765 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $chatServiceSid * @property string $friendlyName * @property string $type * @property string[] $permissions * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class RoleInstance extends InstanceResource { /** * Initialize the RoleInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the Role resource to fetch */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Update the RoleInstance * * @param string[] $permission A permission the role should have * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $permission): RoleInstance { return $this->proxy()->update($permission); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Conversations/V1/ConfigurationOptions.php 0000644 00000013317 15107452337 0014577 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Options; use Twilio\Values; abstract class ConfigurationOptions { /** * @param string $defaultChatServiceSid The SID of the default Conversation * Service that every new conversation * will be associated with. * @param string $defaultMessagingServiceSid The SID of the default Messaging * Service that every new * conversation will be associated * with. * @param string $defaultInactiveTimer Default ISO8601 duration when * conversation will be switched to * `inactive` state. * @param string $defaultClosedTimer Default ISO8601 duration when conversation * will be switched to `closed` state. * @return UpdateConfigurationOptions Options builder */ public static function update(string $defaultChatServiceSid = Values::NONE, string $defaultMessagingServiceSid = Values::NONE, string $defaultInactiveTimer = Values::NONE, string $defaultClosedTimer = Values::NONE): UpdateConfigurationOptions { return new UpdateConfigurationOptions($defaultChatServiceSid, $defaultMessagingServiceSid, $defaultInactiveTimer, $defaultClosedTimer); } } class UpdateConfigurationOptions extends Options { /** * @param string $defaultChatServiceSid The SID of the default Conversation * Service that every new conversation * will be associated with. * @param string $defaultMessagingServiceSid The SID of the default Messaging * Service that every new * conversation will be associated * with. * @param string $defaultInactiveTimer Default ISO8601 duration when * conversation will be switched to * `inactive` state. * @param string $defaultClosedTimer Default ISO8601 duration when conversation * will be switched to `closed` state. */ public function __construct(string $defaultChatServiceSid = Values::NONE, string $defaultMessagingServiceSid = Values::NONE, string $defaultInactiveTimer = Values::NONE, string $defaultClosedTimer = Values::NONE) { $this->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 that every new conversation * will be associated with. * @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/sms/services/api) to use when creating a conversation. * * @param string $defaultMessagingServiceSid The SID of the default Messaging * Service that every new * conversation will be associated * with. * @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. * @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. * @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 . ']'; } } Conversations/V1.php 0000644 00000011762 15107452337 0010416 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Conversations\V1\AddressConfigurationList; use Twilio\Rest\Conversations\V1\ConfigurationList; use Twilio\Rest\Conversations\V1\ConversationList; use Twilio\Rest\Conversations\V1\CredentialList; use Twilio\Rest\Conversations\V1\ParticipantConversationList; use Twilio\Rest\Conversations\V1\RoleList; use Twilio\Rest\Conversations\V1\ServiceList; use Twilio\Rest\Conversations\V1\UserList; use Twilio\Version; /** * @property ConfigurationList $configuration * @property AddressConfigurationList $addressConfigurations * @property ConversationList $conversations * @property CredentialList $credentials * @property ParticipantConversationList $participantConversations * @property RoleList $roles * @property ServiceList $services * @property UserList $users * @method \Twilio\Rest\Conversations\V1\AddressConfigurationContext addressConfigurations(string $sid) * @method \Twilio\Rest\Conversations\V1\ConversationContext conversations(string $sid) * @method \Twilio\Rest\Conversations\V1\CredentialContext credentials(string $sid) * @method \Twilio\Rest\Conversations\V1\RoleContext roles(string $sid) * @method \Twilio\Rest\Conversations\V1\ServiceContext services(string $sid) * @method \Twilio\Rest\Conversations\V1\UserContext users(string $sid) */ class V1 extends Version { protected $_configuration; protected $_addressConfigurations; protected $_conversations; protected $_credentials; protected $_participantConversations; protected $_roles; protected $_services; protected $_users; /** * Construct the V1 version of Conversations * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } protected function getConfiguration(): ConfigurationList { if (!$this->_configuration) { $this->_configuration = new ConfigurationList($this); } return $this->_configuration; } protected function getAddressConfigurations(): AddressConfigurationList { if (!$this->_addressConfigurations) { $this->_addressConfigurations = new AddressConfigurationList($this); } return $this->_addressConfigurations; } 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]'; } } FlexApi/V1/InsightsQuestionnairesQuestionPage.php 0000644 00000002721 15107452337 0016153 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class InsightsQuestionnairesQuestionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } FlexApi/V1/AssessmentsInstance.php 0000644 00000010613 15107452337 0013100 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $assessmentId * @property string $offset * @property bool $report * @property string $weight * @property string $agentId * @property string $segmentId * @property string $userName * @property string $userEmail * @property string $answerText * @property string $answerId * @property array $assessment * @property string $timestamp * @property string $url */ class AssessmentsInstance extends InstanceResource { /** * Initialize the AssessmentsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assessmentId Assessment Id */ public function __construct(Version $version, array $payload, string $assessmentId = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'assessmentId' => Values::array_get($payload, 'assessment_id'), '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 = ['assessmentId' => $assessmentId ?: $this->properties['assessmentId'], ]; } /** * 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['assessmentId']); } return $this->context; } /** * Update the AssessmentsInstance * * @param string $offset offset * @param string $answerText Answer text * @param string $answerId Answer Id * @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) . ']'; } } FlexApi/V1/InsightsQuestionnairesQuestionList.php 0000644 00000016236 15107452337 0016220 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class InsightsQuestionnairesQuestionList extends ListResource { /** * Construct the InsightsQuestionnairesQuestionList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Insights/QM/Questions'; } /** * Create the InsightsQuestionnairesQuestionInstance * * @param string $categoryId Category ID * @param string $question The question. * @param string $description The question description. * @param string $answerSetId The answer_set for question. * @param bool $allowNa Flag to enable NA for answer. * @param array|Options $options Optional Arguments * @return InsightsQuestionnairesQuestionInstance Created * InsightsQuestionnairesQuestionInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $categoryId, string $question, string $description, string $answerSetId, bool $allowNa, array $options = []): InsightsQuestionnairesQuestionInstance { $options = new Values($options); $data = Values::of([ 'CategoryId' => $categoryId, 'Question' => $question, 'Description' => $description, 'AnswerSetId' => $answerSetId, 'AllowNa' => Serialize::booleanToString($allowNa), ]); $headers = Values::of(['Token' => $options['token'], ]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new InsightsQuestionnairesQuestionInstance($this->version, $payload); } /** * 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']); } /** * 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); } /** * Retrieve a single page of InsightsQuestionnairesQuestionInstance records * from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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([ 'CategoryId' => Serialize::map($options['categoryId'], function($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $headers = Values::of(['Token' => $options['token'], ]); $response = $this->version->page('GET', $this->uri, $params, [], $headers); 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 $questionId Unique Question ID */ public function getContext(string $questionId): InsightsQuestionnairesQuestionContext { return new InsightsQuestionnairesQuestionContext($this->version, $questionId); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.FlexApi.V1.InsightsQuestionnairesQuestionList]'; } } FlexApi/V1/InsightsQuestionnairesList.php 0000644 00000015034 15107452337 0014463 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class InsightsQuestionnairesList extends ListResource { /** * Construct the InsightsQuestionnairesList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Insights/QM/Questionnaires'; } /** * Create the InsightsQuestionnairesInstance * * @param string $name The questionnaire name * @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']), 'QuestionIds' => Serialize::map($options['questionIds'], function($e) { return $e; }), ]); $headers = Values::of(['Token' => $options['token'], ]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new InsightsQuestionnairesInstance($this->version, $payload); } /** * 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']); } /** * 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); } /** * Retrieve a single page of InsightsQuestionnairesInstance records from the * API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $headers = Values::of(['Token' => $options['token'], ]); $response = $this->version->page('GET', $this->uri, $params, [], $headers); 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 $id Unique Questionnaire ID */ public function getContext(string $id): InsightsQuestionnairesContext { return new InsightsQuestionnairesContext($this->version, $id); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.FlexApi.V1.InsightsQuestionnairesList]'; } } FlexApi/V1/InsightsQuestionnairesCategoryInstance.php 0000644 00000007763 15107452337 0017024 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $categoryId * @property string $name * @property string $url */ class InsightsQuestionnairesCategoryInstance extends InstanceResource { /** * Initialize the InsightsQuestionnairesCategoryInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $categoryId Category ID to update */ public function __construct(Version $version, array $payload, string $categoryId = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'categoryId' => Values::array_get($payload, 'category_id'), 'name' => Values::array_get($payload, 'name'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['categoryId' => $categoryId ?: $this->properties['categoryId'], ]; } /** * 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['categoryId'] ); } return $this->context; } /** * Update the InsightsQuestionnairesCategoryInstance * * @param string $name The category name. * @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); } /** * 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); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } FlexApi/V1/InsightsQuestionnairesPage.php 0000644 00000002641 15107452337 0014424 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class InsightsQuestionnairesPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } FlexApi/V1/InsightsQuestionnairesQuestionContext.php 0000644 00000006114 15107452337 0016723 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class InsightsQuestionnairesQuestionContext extends InstanceContext { /** * Initialize the InsightsQuestionnairesQuestionContext * * @param Version $version Version that contains the resource * @param string $questionId Unique Question ID */ public function __construct(Version $version, $questionId) { parent::__construct($version); // Path Solution $this->solution = ['questionId' => $questionId, ]; $this->uri = '/Insights/QM/Questions/' . \rawurlencode($questionId) . ''; } /** * Update the InsightsQuestionnairesQuestionInstance * * @param bool $allowNa Flag to enable 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), 'CategoryId' => $options['categoryId'], 'Question' => $options['question'], 'Description' => $options['description'], 'AnswerSetId' => $options['answerSetId'], ]); $headers = Values::of(['Token' => $options['token'], ]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new InsightsQuestionnairesQuestionInstance( $this->version, $payload, $this->solution['questionId'] ); } /** * 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(['Token' => $options['token'], ]); 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.FlexApi.V1.InsightsQuestionnairesQuestionContext ' . \implode(' ', $context) . ']'; } } FlexApi/V1/FlexFlowInstance.php 0000644 00000011174 15107452337 0012321 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $sid * @property string $friendlyName * @property string $chatServiceSid * @property string $channelType * @property string $contactIdentity * @property bool $enabled * @property string $integrationType * @property array $integration * @property bool $longLived * @property bool $janitorEnabled * @property string $url */ class FlexFlowInstance extends InstanceResource { /** * Initialize the FlexFlowInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } FlexApi/V1/InsightsSettingsAnswerSetsPage.php 0000644 00000002671 15107452337 0015235 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class InsightsSettingsAnswerSetsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } FlexApi/V1/InsightsQuestionnairesCategoryOptions.php 0000644 00000012262 15107452337 0016701 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class InsightsQuestionnairesCategoryOptions { /** * @param string $token The Token HTTP request header * @return CreateInsightsQuestionnairesCategoryOptions Options builder */ public static function create(string $token = Values::NONE): CreateInsightsQuestionnairesCategoryOptions { return new CreateInsightsQuestionnairesCategoryOptions($token); } /** * @param string $token The Token HTTP request header * @return UpdateInsightsQuestionnairesCategoryOptions Options builder */ public static function update(string $token = Values::NONE): UpdateInsightsQuestionnairesCategoryOptions { return new UpdateInsightsQuestionnairesCategoryOptions($token); } /** * @param string $token The Token HTTP request header * @return ReadInsightsQuestionnairesCategoryOptions Options builder */ public static function read(string $token = Values::NONE): ReadInsightsQuestionnairesCategoryOptions { return new ReadInsightsQuestionnairesCategoryOptions($token); } /** * @param string $token The Token HTTP request header * @return DeleteInsightsQuestionnairesCategoryOptions Options builder */ public static function delete(string $token = Values::NONE): DeleteInsightsQuestionnairesCategoryOptions { return new DeleteInsightsQuestionnairesCategoryOptions($token); } } class CreateInsightsQuestionnairesCategoryOptions extends Options { /** * @param string $token The Token HTTP request header */ public function __construct(string $token = Values::NONE) { $this->options['token'] = $token; } /** * The Token HTTP request header * * @param string $token The Token HTTP request header * @return $this Fluent Builder */ public function setToken(string $token): self { $this->options['token'] = $token; return $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 UpdateInsightsQuestionnairesCategoryOptions extends Options { /** * @param string $token The Token HTTP request header */ public function __construct(string $token = Values::NONE) { $this->options['token'] = $token; } /** * The Token HTTP request header * * @param string $token The Token HTTP request header * @return $this Fluent Builder */ public function setToken(string $token): self { $this->options['token'] = $token; return $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 . ']'; } } class ReadInsightsQuestionnairesCategoryOptions extends Options { /** * @param string $token The Token HTTP request header */ public function __construct(string $token = Values::NONE) { $this->options['token'] = $token; } /** * The Token HTTP request header * * @param string $token The Token HTTP request header * @return $this Fluent Builder */ public function setToken(string $token): self { $this->options['token'] = $token; return $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 DeleteInsightsQuestionnairesCategoryOptions extends Options { /** * @param string $token The Token HTTP request header */ public function __construct(string $token = Values::NONE) { $this->options['token'] = $token; } /** * The Token HTTP request header * * @param string $token The Token HTTP request header * @return $this Fluent Builder */ public function setToken(string $token): self { $this->options['token'] = $token; return $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 . ']'; } } FlexApi/V1/InsightsUserRolesInstance.php 0000644 00000005632 15107452337 0014231 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string[] $roles * @property string $url */ class InsightsUserRolesInstance extends InstanceResource { /** * Initialize the InsightsUserRolesInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } FlexApi/V1/InsightsUserRolesList.php 0000644 00000002204 15107452337 0013370 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class InsightsUserRolesList extends ListResource { /** * Construct the InsightsUserRolesList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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]'; } } FlexApi/V1/ChannelOptions.php 0000644 00000011063 15107452337 0012027 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Options; use Twilio\Values; abstract class ChannelOptions { /** * @param string $target The Target Contact Identity * @param string $chatUniqueName The chat channel's unique name * @param string $preEngagementData The pre-engagement data * @param string $taskSid The SID of the TaskRouter Task * @param string $taskAttributes The Task attributes to be added for the * TaskRouter Task * @param bool $longLived Whether to create the channel as long-lived * @return CreateChannelOptions Options builder */ public static function create(string $target = Values::NONE, string $chatUniqueName = Values::NONE, string $preEngagementData = Values::NONE, string $taskSid = Values::NONE, string $taskAttributes = Values::NONE, bool $longLived = Values::NONE): CreateChannelOptions { return new CreateChannelOptions($target, $chatUniqueName, $preEngagementData, $taskSid, $taskAttributes, $longLived); } } class CreateChannelOptions extends Options { /** * @param string $target The Target Contact Identity * @param string $chatUniqueName The chat channel's unique name * @param string $preEngagementData The pre-engagement data * @param string $taskSid The SID of the TaskRouter Task * @param string $taskAttributes The Task attributes to be added for the * TaskRouter Task * @param bool $longLived Whether to create the channel as long-lived */ public function __construct(string $target = Values::NONE, string $chatUniqueName = Values::NONE, string $preEngagementData = Values::NONE, string $taskSid = Values::NONE, string $taskAttributes = Values::NONE, bool $longLived = Values::NONE) { $this->options['target'] = $target; $this->options['chatUniqueName'] = $chatUniqueName; $this->options['preEngagementData'] = $preEngagementData; $this->options['taskSid'] = $taskSid; $this->options['taskAttributes'] = $taskAttributes; $this->options['longLived'] = $longLived; } /** * The Target Contact Identity, for example the phone number of an SMS. * * @param string $target The Target Contact Identity * @return $this Fluent Builder */ public function setTarget(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 * @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 . ']'; } } FlexApi/V1/AssessmentsPage.php 0000644 00000002537 15107452337 0012216 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AssessmentsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } FlexApi/V1/InsightsSessionPage.php 0000644 00000002567 15107452337 0013045 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class InsightsSessionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } FlexApi/V1/InsightsSessionContext.php 0000644 00000003510 15107452337 0013602 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class InsightsSessionContext extends InstanceContext { /** * Initialize the InsightsSessionContext * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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(['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) . ']'; } } FlexApi/V1/ChannelPage.php 0000644 00000002174 15107452337 0011253 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ChannelPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } FlexApi/V1/InsightsSettingsAnswerSetsInstance.php 0000644 00000004404 15107452337 0016121 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property array $answerSets * @property array $answerSetCategories * @property array $notApplicable * @property string $url */ class InsightsSettingsAnswerSetsInstance extends InstanceResource { /** * Initialize the InsightsSettingsAnswerSetsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->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]'; } } FlexApi/V1/InsightsAssessmentsCommentInstance.php 0000644 00000005563 15107452337 0016144 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $assessmentId * @property array $comment * @property string $offset * @property bool $report * @property string $weight * @property string $agentId * @property string $segmentId * @property string $userName * @property string $userEmail * @property string $timestamp * @property string $url */ class InsightsAssessmentsCommentInstance extends InstanceResource { /** * Initialize the InsightsAssessmentsCommentInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'assessmentId' => Values::array_get($payload, 'assessment_id'), '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]'; } } FlexApi/V1/InteractionInstance.php 0000644 00000006307 15107452337 0013054 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Rest\FlexApi\V1\Interaction\InteractionChannelList; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property array $channel * @property array $routing * @property string $url * @property array $links */ class InteractionInstance extends InstanceResource { protected $_channels; /** * Initialize the InteractionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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'), ]; $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) . ']'; } } FlexApi/V1/ConfigurationList.php 0000644 00000001641 15107452337 0012547 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\ListResource; use Twilio\Version; class ConfigurationList extends ListResource { /** * Construct the ConfigurationList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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]'; } } FlexApi/V1/InsightsSettingsCommentInstance.php 0000644 00000004001 15107452337 0015416 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property array $comments * @property string $url */ class InsightsSettingsCommentInstance extends InstanceResource { /** * Initialize the InsightsSettingsCommentInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->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]'; } } FlexApi/V1/ConfigurationContext.php 0000644 00000004516 15107452337 0013264 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class ConfigurationContext extends InstanceContext { /** * Initialize the ConfigurationContext * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->fetch('GET', $this->uri, $params); return new ConfigurationInstance($this->version, $payload); } /** * Create the ConfigurationInstance * * @return ConfigurationInstance Created ConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function create(): ConfigurationInstance { $payload = $this->version->create('POST', $this->uri); return new ConfigurationInstance($this->version, $payload); } /** * Update the ConfigurationInstance * * @return ConfigurationInstance Updated ConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(): ConfigurationInstance { $payload = $this->version->update('POST', $this->uri); 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) . ']'; } } FlexApi/V1/ChannelList.php 0000644 00000014127 15107452337 0011313 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ChannelList extends ListResource { /** * Construct the ChannelList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Channels'; } /** * Streams ChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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); } /** * Create the ChannelInstance * * @param string $flexFlowSid The SID of the Flex Flow * @param string $identity The identity value that identifies the new * resource's chat User * @param string $chatUserFriendlyName The chat participant's friendly name * @param string $chatFriendlyName The chat channel's friendly name * @param array|Options $options Optional Arguments * @return ChannelInstance 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']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ChannelInstance($this->version, $payload); } /** * Constructs a ChannelContext * * @param string $sid The SID that identifies the Flex chat channel resource to * fetch */ 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]'; } } FlexApi/V1/FlexFlowList.php 0000644 00000015632 15107452337 0011473 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class FlexFlowList extends ListResource { /** * Construct the FlexFlowList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/FlexFlows'; } /** * Streams FlexFlowInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of FlexFlowInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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); } /** * Create the FlexFlowInstance * * @param string $friendlyName A string to describe the resource * @param string $chatServiceSid The SID of the chat service * @param string $channelType The channel type * @param array|Options $options Optional Arguments * @return FlexFlowInstance 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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new FlexFlowInstance($this->version, $payload); } /** * Constructs a FlexFlowContext * * @param string $sid The SID that identifies the resource to fetch */ 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]'; } } FlexApi/V1/ConfigurationPage.php 0000644 00000002240 15107452337 0012504 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ConfigurationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } FlexApi/V1/ConfigurationInstance.php 0000644 00000021050 15107452337 0013374 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property array $attributes * @property string $status * @property string $taskrouterWorkspaceSid * @property string $taskrouterTargetWorkflowSid * @property string $taskrouterTargetTaskqueueSid * @property array[] $taskrouterTaskqueues * @property array[] $taskrouterSkills * @property array $taskrouterWorkerChannels * @property array $taskrouterWorkerAttributes * @property string $taskrouterOfflineActivitySid * @property string $runtimeDomain * @property string $messagingServiceInstanceSid * @property string $chatServiceInstanceSid * @property string $flexServiceInstanceSid * @property string $uiLanguage * @property array $uiAttributes * @property array $uiDependencies * @property string $uiVersion * @property string $serviceVersion * @property bool $callRecordingEnabled * @property string $callRecordingWebhookUrl * @property bool $crmEnabled * @property string $crmType * @property string $crmCallbackUrl * @property string $crmFallbackUrl * @property array $crmAttributes * @property array $publicAttributes * @property bool $pluginServiceEnabled * @property array $pluginServiceAttributes * @property array[] $integrations * @property array $outboundCallFlows * @property string[] $serverlessServiceSids * @property array $queueStatsConfiguration * @property array $notifications * @property array $markdown * @property string $url * @property array $flexInsightsHr * @property bool $flexInsightsDrilldown * @property string $flexUrl * @property array[] $channelConfigs * @property array $debuggerIntegration * @property array $flexUiStatusReport */ class ConfigurationInstance extends InstanceResource { /** * Initialize the ConfigurationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->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'), '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'), ]; $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); } /** * Create the ConfigurationInstance * * @return ConfigurationInstance Created ConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function create(): ConfigurationInstance { return $this->proxy()->create(); } /** * 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) . ']'; } } FlexApi/V1/InsightsQuestionnairesContext.php 0000644 00000006752 15107452337 0015203 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class InsightsQuestionnairesContext extends InstanceContext { /** * Initialize the InsightsQuestionnairesContext * * @param Version $version Version that contains the resource * @param string $id Unique Questionnaire ID */ public function __construct(Version $version, $id) { parent::__construct($version); // Path Solution $this->solution = ['id' => $id, ]; $this->uri = '/Insights/QM/Questionnaires/' . \rawurlencode($id) . ''; } /** * Update the InsightsQuestionnairesInstance * * @param bool $active Is questionnaire enabled ? * @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'], 'QuestionIds' => Serialize::map($options['questionIds'], function($e) { return $e; }), ]); $headers = Values::of(['Token' => $options['token'], ]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new InsightsQuestionnairesInstance($this->version, $payload, $this->solution['id']); } /** * 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(['Token' => $options['token'], ]); 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(['Token' => $options['token'], ]); $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); return new InsightsQuestionnairesInstance($this->version, $payload, $this->solution['id']); } /** * Provide 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) . ']'; } } FlexApi/V1/FlexFlowOptions.php 0000644 00000067076 15107452337 0012224 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Options; use Twilio\Values; abstract class FlexFlowOptions { /** * @param string $friendlyName The `friendly_name` of the Flex Flow resources * to read * @return ReadFlexFlowOptions Options builder */ public static function read(string $friendlyName = Values::NONE): ReadFlexFlowOptions { return new ReadFlexFlowOptions($friendlyName); } /** * @param string $contactIdentity The channel contact's Identity * @param bool $enabled Whether the new Flex Flow is enabled * @param string $integrationType The software that will handle inbound * messages. * @param string $integrationFlowSid The SID of the Studio Flow * @param string $integrationUrl The External Webhook URL * @param string $integrationWorkspaceSid The Workspace SID for a new Task * @param string $integrationWorkflowSid The Workflow SID for a new Task * @param string $integrationChannel The Task Channel for a new Task * @param int $integrationTimeout The Task timeout in seconds for a new Task * @param int $integrationPriority The Task priority of a new Task * @param bool $integrationCreationOnMessage Whether to create a Task when the * first message arrives * @param bool $longLived Reuse this chat channel for future interactions with * a contact * @param bool $janitorEnabled Remove active Proxy sessions if the * corresponding Task is deleted * @param int $integrationRetryCount The number of times to retry the Studio * Flow or webhook in case of failure * @return CreateFlexFlowOptions Options builder */ public static function create(string $contactIdentity = Values::NONE, bool $enabled = Values::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::NONE, int $integrationPriority = Values::NONE, bool $integrationCreationOnMessage = Values::NONE, bool $longLived = Values::NONE, bool $janitorEnabled = Values::NONE, int $integrationRetryCount = Values::NONE): CreateFlexFlowOptions { return new CreateFlexFlowOptions($contactIdentity, $enabled, $integrationType, $integrationFlowSid, $integrationUrl, $integrationWorkspaceSid, $integrationWorkflowSid, $integrationChannel, $integrationTimeout, $integrationPriority, $integrationCreationOnMessage, $longLived, $janitorEnabled, $integrationRetryCount); } /** * @param string $friendlyName A string to describe the resource * @param string $chatServiceSid The SID of the chat service * @param string $channelType The channel type * @param string $contactIdentity The channel contact's Identity * @param bool $enabled Whether the new Flex Flow is enabled * @param string $integrationType The software that will handle inbound * messages. * @param string $integrationFlowSid The SID of the Studio Flow * @param string $integrationUrl The External Webhook URL * @param string $integrationWorkspaceSid The Workspace SID for a new Task * @param string $integrationWorkflowSid The Workflow SID for a new Task * @param string $integrationChannel The Task Channel for a new Task * @param int $integrationTimeout The Task timeout in seconds for a new Task * @param int $integrationPriority The Task priority of a new Task * @param bool $integrationCreationOnMessage Whether to create a Task when the * first message arrives * @param bool $longLived Reuse this chat channel for future interactions with * a contact * @param bool $janitorEnabled Remove active Proxy sessions if the * corresponding Task is deleted * @param int $integrationRetryCount The number of times to retry the Studio * Flow or webhook in case of failure * @return UpdateFlexFlowOptions Options builder */ public static function update(string $friendlyName = Values::NONE, string $chatServiceSid = Values::NONE, string $channelType = Values::NONE, string $contactIdentity = Values::NONE, bool $enabled = Values::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::NONE, int $integrationPriority = Values::NONE, bool $integrationCreationOnMessage = Values::NONE, bool $longLived = Values::NONE, bool $janitorEnabled = Values::NONE, int $integrationRetryCount = Values::NONE): UpdateFlexFlowOptions { return new UpdateFlexFlowOptions($friendlyName, $chatServiceSid, $channelType, $contactIdentity, $enabled, $integrationType, $integrationFlowSid, $integrationUrl, $integrationWorkspaceSid, $integrationWorkflowSid, $integrationChannel, $integrationTimeout, $integrationPriority, $integrationCreationOnMessage, $longLived, $janitorEnabled, $integrationRetryCount); } } class ReadFlexFlowOptions extends Options { /** * @param string $friendlyName The `friendly_name` of the 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 CreateFlexFlowOptions extends Options { /** * @param string $contactIdentity The channel contact's Identity * @param bool $enabled Whether the new Flex Flow is enabled * @param string $integrationType The software that will handle inbound * messages. * @param string $integrationFlowSid The SID of the Studio Flow * @param string $integrationUrl The External Webhook URL * @param string $integrationWorkspaceSid The Workspace SID for a new Task * @param string $integrationWorkflowSid The Workflow SID for a new Task * @param string $integrationChannel The Task Channel for a new Task * @param int $integrationTimeout The Task timeout in seconds for a new Task * @param int $integrationPriority The Task priority of a new Task * @param bool $integrationCreationOnMessage Whether to create a Task when the * first message arrives * @param bool $longLived Reuse this chat channel for future interactions with * a contact * @param bool $janitorEnabled Remove active Proxy sessions if the * corresponding Task is deleted * @param int $integrationRetryCount The number of times to retry the Studio * Flow or webhook in case of failure */ public function __construct(string $contactIdentity = Values::NONE, bool $enabled = Values::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::NONE, int $integrationPriority = Values::NONE, bool $integrationCreationOnMessage = Values::NONE, bool $longLived = Values::NONE, bool $janitorEnabled = Values::NONE, int $integrationRetryCount = Values::NONE) { $this->options['contactIdentity'] = $contactIdentity; $this->options['enabled'] = $enabled; $this->options['integrationType'] = $integrationType; $this->options['integrationFlowSid'] = $integrationFlowSid; $this->options['integrationUrl'] = $integrationUrl; $this->options['integrationWorkspaceSid'] = $integrationWorkspaceSid; $this->options['integrationWorkflowSid'] = $integrationWorkflowSid; $this->options['integrationChannel'] = $integrationChannel; $this->options['integrationTimeout'] = $integrationTimeout; $this->options['integrationPriority'] = $integrationPriority; $this->options['integrationCreationOnMessage'] = $integrationCreationOnMessage; $this->options['longLived'] = $longLived; $this->options['janitorEnabled'] = $janitorEnabled; $this->options['integrationRetryCount'] = $integrationRetryCount; } /** * The channel contact's Identity. * * @param string $contactIdentity The channel contact's Identity * @return $this Fluent Builder */ public function setContactIdentity(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; } /** * The software that will handle inbound messages. [Integration Type](https://www.twilio.com/docs/flex/developer/messaging/manage-flows#integration-types) can be: `studio`, `external`, or `task`. * * @param string $integrationType The software that will handle inbound * messages. * @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 * @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 External Webhook URL * @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 * @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 * @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 for a new Task * @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 * @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 * @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 Whether to create a Task when the * first message arrives * @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 Reuse this chat channel for future interactions with * a contact * @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 Remove active Proxy sessions if the * corresponding Task is deleted * @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 * @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 UpdateFlexFlowOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $chatServiceSid The SID of the chat service * @param string $channelType The channel type * @param string $contactIdentity The channel contact's Identity * @param bool $enabled Whether the new Flex Flow is enabled * @param string $integrationType The software that will handle inbound * messages. * @param string $integrationFlowSid The SID of the Studio Flow * @param string $integrationUrl The External Webhook URL * @param string $integrationWorkspaceSid The Workspace SID for a new Task * @param string $integrationWorkflowSid The Workflow SID for a new Task * @param string $integrationChannel The Task Channel for a new Task * @param int $integrationTimeout The Task timeout in seconds for a new Task * @param int $integrationPriority The Task priority of a new Task * @param bool $integrationCreationOnMessage Whether to create a Task when the * first message arrives * @param bool $longLived Reuse this chat channel for future interactions with * a contact * @param bool $janitorEnabled Remove active Proxy sessions if the * corresponding Task is deleted * @param int $integrationRetryCount The number of times to retry the Studio * Flow or webhook in case of failure */ public function __construct(string $friendlyName = Values::NONE, string $chatServiceSid = Values::NONE, string $channelType = Values::NONE, string $contactIdentity = Values::NONE, bool $enabled = Values::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::NONE, int $integrationPriority = Values::NONE, bool $integrationCreationOnMessage = Values::NONE, bool $longLived = Values::NONE, bool $janitorEnabled = Values::NONE, int $integrationRetryCount = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['chatServiceSid'] = $chatServiceSid; $this->options['channelType'] = $channelType; $this->options['contactIdentity'] = $contactIdentity; $this->options['enabled'] = $enabled; $this->options['integrationType'] = $integrationType; $this->options['integrationFlowSid'] = $integrationFlowSid; $this->options['integrationUrl'] = $integrationUrl; $this->options['integrationWorkspaceSid'] = $integrationWorkspaceSid; $this->options['integrationWorkflowSid'] = $integrationWorkflowSid; $this->options['integrationChannel'] = $integrationChannel; $this->options['integrationTimeout'] = $integrationTimeout; $this->options['integrationPriority'] = $integrationPriority; $this->options['integrationCreationOnMessage'] = $integrationCreationOnMessage; $this->options['longLived'] = $longLived; $this->options['janitorEnabled'] = $janitorEnabled; $this->options['integrationRetryCount'] = $integrationRetryCount; } /** * A descriptive string that you create to describe the Flex Flow resource. * * @param string $friendlyName A string to describe the 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; } /** * The channel type. One of `web`, `facebook`, `sms`, `whatsapp`, `line` or `custom`. By default, Studio’s Send to Flex widget passes it on to the Task attributes for Tasks created based on this Flex Flow. The Task attributes will be used by the Flex UI to render the respective Task as appropriate (applying channel-specific design and length limits). If `channelType` is `facebook`, `whatsapp` or `line`, the Send to Flex widget should set the Task Channel to Programmable Chat. * * @param string $channelType The channel type * @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; } /** * The software that will handle inbound messages. [Integration Type](https://www.twilio.com/docs/flex/developer/messaging/manage-flows#integration-types) can be: `studio`, `external`, or `task`. * * @param string $integrationType The software that will handle inbound * messages. * @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 * @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 External Webhook URL * @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 * @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 * @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 for a new Task * @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 * @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 * @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 Whether to create a Task when the * first message arrives * @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 Reuse this chat channel for future interactions with * a contact * @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 Remove active Proxy sessions if the * corresponding Task is deleted * @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 * @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 . ']'; } } FlexApi/V1/InsightsSegmentsPage.php 0000644 00000002575 15107452337 0013206 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class InsightsSegmentsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } FlexApi/V1/InsightsQuestionnairesQuestionOptions.php 0000644 00000017433 15107452337 0016740 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class InsightsQuestionnairesQuestionOptions { /** * @param string $token The Token HTTP request header * @return CreateInsightsQuestionnairesQuestionOptions Options builder */ public static function create(string $token = Values::NONE): CreateInsightsQuestionnairesQuestionOptions { return new CreateInsightsQuestionnairesQuestionOptions($token); } /** * @param string $categoryId Category ID * @param string $question The question. * @param string $description The question description. * @param string $answerSetId The answer_set for question. * @param string $token The Token HTTP request header * @return UpdateInsightsQuestionnairesQuestionOptions Options builder */ public static function update(string $categoryId = Values::NONE, string $question = Values::NONE, string $description = Values::NONE, string $answerSetId = Values::NONE, string $token = Values::NONE): UpdateInsightsQuestionnairesQuestionOptions { return new UpdateInsightsQuestionnairesQuestionOptions($categoryId, $question, $description, $answerSetId, $token); } /** * @param string[] $categoryId List of category Ids * @param string $token The Token HTTP request header * @return ReadInsightsQuestionnairesQuestionOptions Options builder */ public static function read(array $categoryId = Values::ARRAY_NONE, string $token = Values::NONE): ReadInsightsQuestionnairesQuestionOptions { return new ReadInsightsQuestionnairesQuestionOptions($categoryId, $token); } /** * @param string $token The Token HTTP request header * @return DeleteInsightsQuestionnairesQuestionOptions Options builder */ public static function delete(string $token = Values::NONE): DeleteInsightsQuestionnairesQuestionOptions { return new DeleteInsightsQuestionnairesQuestionOptions($token); } } class CreateInsightsQuestionnairesQuestionOptions extends Options { /** * @param string $token The Token HTTP request header */ public function __construct(string $token = Values::NONE) { $this->options['token'] = $token; } /** * The Token HTTP request header * * @param string $token The Token HTTP request header * @return $this Fluent Builder */ public function setToken(string $token): self { $this->options['token'] = $token; return $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 UpdateInsightsQuestionnairesQuestionOptions extends Options { /** * @param string $categoryId Category ID * @param string $question The question. * @param string $description The question description. * @param string $answerSetId The answer_set for question. * @param string $token The Token HTTP request header */ public function __construct(string $categoryId = Values::NONE, string $question = Values::NONE, string $description = Values::NONE, string $answerSetId = Values::NONE, string $token = Values::NONE) { $this->options['categoryId'] = $categoryId; $this->options['question'] = $question; $this->options['description'] = $description; $this->options['answerSetId'] = $answerSetId; $this->options['token'] = $token; } /** * The ID of the category * * @param string $categoryId Category ID * @return $this Fluent Builder */ public function setCategoryId(string $categoryId): self { $this->options['categoryId'] = $categoryId; 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 question description. * @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 question. * @return $this Fluent Builder */ public function setAnswerSetId(string $answerSetId): self { $this->options['answerSetId'] = $answerSetId; return $this; } /** * The Token HTTP request header * * @param string $token The Token HTTP request header * @return $this Fluent Builder */ public function setToken(string $token): self { $this->options['token'] = $token; return $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 . ']'; } } class ReadInsightsQuestionnairesQuestionOptions extends Options { /** * @param string[] $categoryId List of category Ids * @param string $token The Token HTTP request header */ public function __construct(array $categoryId = Values::ARRAY_NONE, string $token = Values::NONE) { $this->options['categoryId'] = $categoryId; $this->options['token'] = $token; } /** * The list of category IDs * * @param string[] $categoryId List of category Ids * @return $this Fluent Builder */ public function setCategoryId(array $categoryId): self { $this->options['categoryId'] = $categoryId; return $this; } /** * The Token HTTP request header * * @param string $token The Token HTTP request header * @return $this Fluent Builder */ public function setToken(string $token): self { $this->options['token'] = $token; return $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 DeleteInsightsQuestionnairesQuestionOptions extends Options { /** * @param string $token The Token HTTP request header */ public function __construct(string $token = Values::NONE) { $this->options['token'] = $token; } /** * The Token HTTP request header * * @param string $token The Token HTTP request header * @return $this Fluent Builder */ public function setToken(string $token): self { $this->options['token'] = $token; return $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 . ']'; } } FlexApi/V1/AssessmentsList.php 0000644 00000006166 15107452337 0012257 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AssessmentsList extends ListResource { /** * Construct the AssessmentsList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Insights/QM/Assessments'; } /** * Create the AssessmentsInstance * * @param string $categoryId Category Id * @param string $categoryName Category name * @param string $segmentId Segment Id * @param string $userName User Name * @param string $userEmail User Email * @param string $agentId AgentID * @param string $offset offset. * @param string $metricId Question Id * @param string $metricName Question name * @param string $answerText Answer text * @param string $answerId Answer Id * @param string $questionnaireId Questionnaire Id * @param array|Options $options Optional Arguments * @return AssessmentsInstance Created AssessmentsInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $categoryId, string $categoryName, string $segmentId, string $userName, string $userEmail, string $agentId, string $offset, string $metricId, string $metricName, string $answerText, string $answerId, string $questionnaireId, array $options = []): AssessmentsInstance { $options = new Values($options); $data = Values::of([ 'CategoryId' => $categoryId, 'CategoryName' => $categoryName, 'SegmentId' => $segmentId, 'UserName' => $userName, 'UserEmail' => $userEmail, 'AgentId' => $agentId, 'Offset' => $offset, 'MetricId' => $metricId, 'MetricName' => $metricName, 'AnswerText' => $answerText, 'AnswerId' => $answerId, 'QuestionnaireId' => $questionnaireId, ]); $headers = Values::of(['Token' => $options['token'], ]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new AssessmentsInstance($this->version, $payload); } /** * Constructs a AssessmentsContext * * @param string $assessmentId Assessment Id */ public function getContext(string $assessmentId): AssessmentsContext { return new AssessmentsContext($this->version, $assessmentId); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.FlexApi.V1.AssessmentsList]'; } } FlexApi/V1/InsightsSegmentsInstance.php 0000644 00000012402 15107452337 0014064 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $segmentId * @property string $externalId * @property string $queue * @property string $externalContact * @property string $externalSegmentLinkId * @property string $date * @property string $accountId * @property string $externalSegmentLink * @property string $agentId * @property string $agentPhone * @property string $agentName * @property string $agentTeamName * @property string $agentTeamNameInHierarchy * @property string $agentLink * @property string $customerPhone * @property string $customerName * @property string $customerLink * @property string $segmentRecordingOffset * @property array $media * @property array $assessmentType * @property array $assessmentPercentage * @property string $url */ class InsightsSegmentsInstance extends InstanceResource { /** * Initialize the InsightsSegmentsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $segmentId Unique segment Id */ public function __construct(Version $version, array $payload, string $segmentId = null) { parent::__construct($version); // Marshaled Properties $this->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 = ['segmentId' => $segmentId ?: $this->properties['segmentId'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return InsightsSegmentsContext Context for this InsightsSegmentsInstance */ protected function proxy(): InsightsSegmentsContext { if (!$this->context) { $this->context = new InsightsSegmentsContext($this->version, $this->solution['segmentId']); } return $this->context; } /** * Fetch the InsightsSegmentsInstance * * @param array|Options $options Optional Arguments * @return InsightsSegmentsInstance Fetched InsightsSegmentsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): InsightsSegmentsInstance { 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.InsightsSegmentsInstance ' . \implode(' ', $context) . ']'; } } FlexApi/V1/InsightsSessionOptions.php 0000644 00000003247 15107452337 0013620 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class InsightsSessionOptions { /** * @param string $authorization The Authorization HTTP request header * @return CreateInsightsSessionOptions Options builder */ public static function create(string $authorization = Values::NONE): CreateInsightsSessionOptions { return new CreateInsightsSessionOptions($authorization); } } class CreateInsightsSessionOptions 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.CreateInsightsSessionOptions ' . $options . ']'; } } FlexApi/V1/InsightsSegmentsContext.php 0000644 00000003726 15107452337 0013755 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class InsightsSegmentsContext extends InstanceContext { /** * Initialize the InsightsSegmentsContext * * @param Version $version Version that contains the resource * @param string $segmentId Unique segment Id */ public function __construct(Version $version, $segmentId) { parent::__construct($version); // Path Solution $this->solution = ['segmentId' => $segmentId, ]; $this->uri = '/Insights/Segments/' . \rawurlencode($segmentId) . ''; } /** * Fetch the InsightsSegmentsInstance * * @param array|Options $options Optional Arguments * @return InsightsSegmentsInstance Fetched InsightsSegmentsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): InsightsSegmentsInstance { $options = new Values($options); $headers = Values::of(['Token' => $options['token'], ]); $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); return new InsightsSegmentsInstance($this->version, $payload, $this->solution['segmentId']); } /** * Provide 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.InsightsSegmentsContext ' . \implode(' ', $context) . ']'; } } FlexApi/V1/InsightsUserRolesPage.php 0000644 00000002603 15107452337 0013334 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class InsightsUserRolesPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } FlexApi/V1/InsightsSessionList.php 0000644 00000002170 15107452337 0013072 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class InsightsSessionList extends ListResource { /** * Construct the InsightsSessionList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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]'; } } FlexApi/V1/WebChannelList.php 0000644 00000013455 15107452337 0011754 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class WebChannelList extends ListResource { /** * Construct the WebChannelList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/WebChannels'; } /** * Streams WebChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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); } /** * 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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new WebChannelInstance($this->version, $payload); } /** * Constructs a WebChannelContext * * @param string $sid The SID of the WebChannel resource to fetch */ 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]'; } } FlexApi/V1/InsightsQuestionnairesInstance.php 0000644 00000010650 15107452337 0015313 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $id * @property string $name * @property string $description * @property bool $active * @property array[] $questions * @property string $url */ class InsightsQuestionnairesInstance extends InstanceResource { /** * Initialize the InsightsQuestionnairesInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $id Unique Questionnaire ID */ public function __construct(Version $version, array $payload, string $id = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'id' => Values::array_get($payload, 'id'), '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 = ['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 InsightsQuestionnairesContext Context for this * InsightsQuestionnairesInstance */ protected function proxy(): InsightsQuestionnairesContext { if (!$this->context) { $this->context = new InsightsQuestionnairesContext($this->version, $this->solution['id']); } return $this->context; } /** * Update the InsightsQuestionnairesInstance * * @param bool $active Is questionnaire enabled ? * @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); } /** * 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); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } FlexApi/V1/InsightsSettingsAnswerSetsOptions.php 0000644 00000003143 15107452337 0016007 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class InsightsSettingsAnswerSetsOptions { /** * @param string $token The Token HTTP request header * @return FetchInsightsSettingsAnswerSetsOptions Options builder */ public static function fetch(string $token = Values::NONE): FetchInsightsSettingsAnswerSetsOptions { return new FetchInsightsSettingsAnswerSetsOptions($token); } } class FetchInsightsSettingsAnswerSetsOptions extends Options { /** * @param string $token The Token HTTP request header */ public function __construct(string $token = Values::NONE) { $this->options['token'] = $token; } /** * The Token HTTP request header * * @param string $token The Token HTTP request header * @return $this Fluent Builder */ public function setToken(string $token): self { $this->options['token'] = $token; return $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 . ']'; } } FlexApi/V1/InsightsSettingsCommentList.php 0000644 00000003404 15107452337 0014573 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class InsightsSettingsCommentList extends ListResource { /** * Construct the InsightsSettingsCommentList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Insights/QM/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(['Token' => $options['token'], ]); $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]'; } } FlexApi/V1/InsightsSettingsAnswerSetsList.php 0000644 00000003436 15107452337 0015274 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class InsightsSettingsAnswerSetsList extends ListResource { /** * Construct the InsightsSettingsAnswerSetsList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Insights/QM/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(['Token' => $options['token'], ]); $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]'; } } FlexApi/V1/InsightsQuestionnairesQuestionInstance.php 0000644 00000011130 15107452337 0017035 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $questionId * @property string $question * @property string $description * @property array $category * @property string $answerSetId * @property bool $allowNa * @property int $usage * @property array $answerSet * @property string $url */ class InsightsQuestionnairesQuestionInstance extends InstanceResource { /** * Initialize the InsightsQuestionnairesQuestionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $questionId Unique Question ID */ public function __construct(Version $version, array $payload, string $questionId = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'questionId' => Values::array_get($payload, 'question_id'), '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 = ['questionId' => $questionId ?: $this->properties['questionId'], ]; } /** * 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['questionId'] ); } return $this->context; } /** * Update the InsightsQuestionnairesQuestionInstance * * @param bool $allowNa Flag to enable 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); } /** * 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); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } FlexApi/V1/FlexFlowContext.php 0000644 00000007015 15107452337 0012200 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class FlexFlowContext extends InstanceContext { /** * Initialize the FlexFlowContext * * @param Version $version Version that contains the resource * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/FlexFlows/' . \rawurlencode($sid) . ''; } /** * Fetch the FlexFlowInstance * * @return FlexFlowInstance Fetched FlexFlowInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FlexFlowInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new FlexFlowInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the FlexFlowInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } FlexApi/V1/InsightsQuestionnairesCategoryPage.php 0000644 00000002721 15107452337 0016121 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class InsightsQuestionnairesCategoryPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } FlexApi/V1/InteractionContext.php 0000644 00000006207 15107452337 0012733 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\FlexApi\V1\Interaction\InteractionChannelList; use Twilio\Values; use Twilio\Version; /** * @property InteractionChannelList $channels * @method \Twilio\Rest\FlexApi\V1\Interaction\InteractionChannelContext channels(string $sid) */ class InteractionContext extends InstanceContext { protected $_channels; /** * Initialize the InteractionContext * * @param Version $version Version that contains the resource * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } FlexApi/V1/AssessmentsOptions.php 0000644 00000005157 15107452337 0012776 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class AssessmentsOptions { /** * @param string $token The Token HTTP request header * @return CreateAssessmentsOptions Options builder */ public static function create(string $token = Values::NONE): CreateAssessmentsOptions { return new CreateAssessmentsOptions($token); } /** * @param string $token The Token HTTP request header * @return UpdateAssessmentsOptions Options builder */ public static function update(string $token = Values::NONE): UpdateAssessmentsOptions { return new UpdateAssessmentsOptions($token); } } class CreateAssessmentsOptions extends Options { /** * @param string $token The Token HTTP request header */ public function __construct(string $token = Values::NONE) { $this->options['token'] = $token; } /** * The Token HTTP request header * * @param string $token The Token HTTP request header * @return $this Fluent Builder */ public function setToken(string $token): self { $this->options['token'] = $token; return $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 UpdateAssessmentsOptions extends Options { /** * @param string $token The Token HTTP request header */ public function __construct(string $token = Values::NONE) { $this->options['token'] = $token; } /** * The Token HTTP request header * * @param string $token The Token HTTP request header * @return $this Fluent Builder */ public function setToken(string $token): self { $this->options['token'] = $token; return $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 . ']'; } } FlexApi/V1/InsightsSegmentsOptions.php 0000644 00000006346 15107452337 0013765 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class InsightsSegmentsOptions { /** * @param string $token The Token HTTP request header * @return FetchInsightsSegmentsOptions Options builder */ public static function fetch(string $token = Values::NONE): FetchInsightsSegmentsOptions { return new FetchInsightsSegmentsOptions($token); } /** * @param string[] $reservationId List of reservation Ids * @param string $token The Token HTTP request header * @return ReadInsightsSegmentsOptions Options builder */ public static function read(array $reservationId = Values::ARRAY_NONE, string $token = Values::NONE): ReadInsightsSegmentsOptions { return new ReadInsightsSegmentsOptions($reservationId, $token); } } class FetchInsightsSegmentsOptions extends Options { /** * @param string $token The Token HTTP request header */ public function __construct(string $token = Values::NONE) { $this->options['token'] = $token; } /** * The Token HTTP request header * * @param string $token The Token HTTP request header * @return $this Fluent Builder */ public function setToken(string $token): self { $this->options['token'] = $token; return $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.FetchInsightsSegmentsOptions ' . $options . ']'; } } class ReadInsightsSegmentsOptions extends Options { /** * @param string[] $reservationId List of reservation Ids * @param string $token The Token HTTP request header */ public function __construct(array $reservationId = Values::ARRAY_NONE, string $token = Values::NONE) { $this->options['reservationId'] = $reservationId; $this->options['token'] = $token; } /** * The list of reservation Ids * * @param string[] $reservationId List of reservation Ids * @return $this Fluent Builder */ public function setReservationId(array $reservationId): self { $this->options['reservationId'] = $reservationId; return $this; } /** * The Token HTTP request header * * @param string $token The Token HTTP request header * @return $this Fluent Builder */ public function setToken(string $token): self { $this->options['token'] = $token; return $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 . ']'; } } FlexApi/V1/InsightsSettingsCommentPage.php 0000644 00000002647 15107452337 0014544 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class InsightsSettingsCommentPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } FlexApi/V1/ChannelInstance.php 0000644 00000007173 15107452337 0012147 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $flexFlowSid * @property string $sid * @property string $userSid * @property string $taskSid * @property string $url * @property \DateTime $dateCreated * @property \DateTime $dateUpdated */ class ChannelInstance extends InstanceResource { /** * Initialize the ChannelInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID that identifies the Flex chat channel resource to * fetch */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the ChannelInstance * * @return ChannelInstance Fetched ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ChannelInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } FlexApi/V1/WebChannelContext.php 0000644 00000004706 15107452337 0012464 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class WebChannelContext extends InstanceContext { /** * Initialize the WebChannelContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the WebChannel resource to fetch */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/WebChannels/' . \rawurlencode($sid) . ''; } /** * Fetch the WebChannelInstance * * @return WebChannelInstance Fetched WebChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WebChannelInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new WebChannelInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the WebChannelInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } FlexApi/V1/ChannelContext.php 0000644 00000003432 15107452337 0012021 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class ChannelContext extends InstanceContext { /** * Initialize the ChannelContext * * @param Version $version Version that contains the resource * @param string $sid The SID that identifies the Flex chat channel resource to * fetch */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Channels/' . \rawurlencode($sid) . ''; } /** * Fetch the ChannelInstance * * @return ChannelInstance Fetched ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ChannelInstance { $payload = $this->version->fetch('GET', $this->uri); return new ChannelInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the ChannelInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } FlexApi/V1/WebChannelOptions.php 0000644 00000007427 15107452337 0012476 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Options; use Twilio\Values; abstract class WebChannelOptions { /** * @param string $chatUniqueName The chat channel's unique name * @param string $preEngagementData The pre-engagement data * @return CreateWebChannelOptions Options builder */ public static function create(string $chatUniqueName = Values::NONE, string $preEngagementData = Values::NONE): CreateWebChannelOptions { return new CreateWebChannelOptions($chatUniqueName, $preEngagementData); } /** * @param string $chatStatus The chat status * @param string $postEngagementData The post-engagement data * @return UpdateWebChannelOptions Options builder */ public static function update(string $chatStatus = Values::NONE, string $postEngagementData = Values::NONE): UpdateWebChannelOptions { return new UpdateWebChannelOptions($chatStatus, $postEngagementData); } } class CreateWebChannelOptions extends Options { /** * @param string $chatUniqueName The chat channel's unique name * @param string $preEngagementData The pre-engagement data */ public function __construct(string $chatUniqueName = Values::NONE, string $preEngagementData = Values::NONE) { $this->options['chatUniqueName'] = $chatUniqueName; $this->options['preEngagementData'] = $preEngagementData; } /** * The chat channel's unique name. * * @param string $chatUniqueName The chat channel's unique name * @return $this Fluent Builder */ public function setChatUniqueName(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 The chat status * @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; } /** * The chat status. Can only be `inactive`. * * @param string $chatStatus The chat status * @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 . ']'; } } FlexApi/V1/InsightsUserRolesContext.php 0000644 00000003526 15107452337 0014111 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class InsightsUserRolesContext extends InstanceContext { /** * Initialize the InsightsUserRolesContext * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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(['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) . ']'; } } FlexApi/V1/WebChannelInstance.php 0000644 00000007460 15107452337 0012604 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $flexFlowSid * @property string $sid * @property string $url * @property \DateTime $dateCreated * @property \DateTime $dateUpdated */ class WebChannelInstance extends InstanceResource { /** * Initialize the WebChannelInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the WebChannel resource to fetch */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } FlexApi/V1/WebChannelPage.php 0000644 00000002216 15107452337 0011706 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class WebChannelPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } FlexApi/V1/InsightsSegmentsList.php 0000644 00000012644 15107452337 0013243 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class InsightsSegmentsList extends ListResource { /** * Construct the InsightsSegmentsList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Insights/Segments'; } /** * 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']); } /** * 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); } /** * Retrieve a single page of InsightsSegmentsInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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([ 'ReservationId' => Serialize::map($options['reservationId'], function($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $headers = Values::of(['Token' => $options['token'], ]); $response = $this->version->page('GET', $this->uri, $params, [], $headers); 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); } /** * Constructs a InsightsSegmentsContext * * @param string $segmentId Unique segment Id */ public function getContext(string $segmentId): InsightsSegmentsContext { return new InsightsSegmentsContext($this->version, $segmentId); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.FlexApi.V1.InsightsSegmentsList]'; } } FlexApi/V1/Interaction/InteractionChannelList.php 0000644 00000011713 15107452337 0015770 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1\Interaction; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class InteractionChannelList extends ListResource { /** * Construct the InteractionChannelList * * @param Version $version Version that contains the resource * @param string $interactionSid The unique string that identifies the resource. */ public function __construct(Version $version, string $interactionSid) { parent::__construct($version); // Path Solution $this->solution = ['interactionSid' => $interactionSid, ]; $this->uri = '/Interactions/' . \rawurlencode($interactionSid) . '/Channels'; } /** * 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']); } /** * 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); } /** * 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 that identifies the resource */ 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]'; } } FlexApi/V1/Interaction/InteractionChannel/InteractionChannelInviteList.php 0000644 00000013333 15107452340 0022711 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1\Interaction\InteractionChannel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class InteractionChannelInviteList extends ListResource { /** * Construct the InteractionChannelInviteList * * @param Version $version Version that contains the resource * @param string $interactionSid The Interaction SID for this Channel * @param string $channelSid The Channel SID for this Invite */ public function __construct(Version $version, string $interactionSid, string $channelSid) { parent::__construct($version); // Path Solution $this->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), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new InteractionChannelInviteInstance( $this->version, $payload, $this->solution['interactionSid'], $this->solution['channelSid'] ); } /** * 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']); } /** * 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); } /** * 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]'; } } FlexApi/V1/Interaction/InteractionChannel/InteractionChannelInviteInstance.php 0000644 00000004431 15107452340 0023541 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1\Interaction\InteractionChannel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $interactionSid * @property string $channelSid * @property array $routing * @property string $url */ class InteractionChannelInviteInstance extends InstanceResource { /** * Initialize the InteractionChannelInviteInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $interactionSid The Interaction SID for this Channel * @param string $channelSid The Channel SID for this Invite */ public function __construct(Version $version, array $payload, string $interactionSid, string $channelSid) { parent::__construct($version); // Marshaled Properties $this->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]'; } } FlexApi/V1/Interaction/InteractionChannel/InteractionChannelInvitePage.php 0000644 00000002634 15107452340 0022654 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1\Interaction\InteractionChannel; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class InteractionChannelInvitePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantInstance.php 0000644 00000007516 15107452340 0024570 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1\Interaction\InteractionChannel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $type * @property string $interactionSid * @property string $channelSid * @property string $url */ class InteractionChannelParticipantInstance extends InstanceResource { /** * Initialize the InteractionChannelParticipantInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $interactionSid The Interaction Sid for this channel. * @param string $channelSid The Channel Sid for this Participant. * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $interactionSid, string $channelSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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'), ]; $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 The Participant's 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) . ']'; } } FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantList.php 0000644 00000015047 15107452340 0023735 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1\Interaction\InteractionChannel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class InteractionChannelParticipantList extends ListResource { /** * Construct the InteractionChannelParticipantList * * @param Version $version Version that contains the resource * @param string $interactionSid The Interaction Sid for this channel. * @param string $channelSid The Channel Sid for this Participant. */ public function __construct(Version $version, string $interactionSid, string $channelSid) { parent::__construct($version); // Path Solution $this->solution = ['interactionSid' => $interactionSid, 'channelSid' => $channelSid, ]; $this->uri = '/Interactions/' . \rawurlencode($interactionSid) . '/Channels/' . \rawurlencode($channelSid) . '/Participants'; } /** * Create the InteractionChannelParticipantInstance * * @param string $type Participant type. * @param array $mediaProperties JSON representing the Media Properties for the * new Participant. * @return InteractionChannelParticipantInstance Created * InteractionChannelParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $type, array $mediaProperties): InteractionChannelParticipantInstance { $data = Values::of(['Type' => $type, 'MediaProperties' => Serialize::jsonObject($mediaProperties), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new InteractionChannelParticipantInstance( $this->version, $payload, $this->solution['interactionSid'], $this->solution['channelSid'] ); } /** * 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']); } /** * 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); } /** * 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 that identifies the 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]'; } } FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantPage.php 0000644 00000002672 15107452340 0023676 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1\Interaction\InteractionChannel; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class InteractionChannelParticipantPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantContext.php 0000644 00000004502 15107452340 0024440 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1\Interaction\InteractionChannel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class InteractionChannelParticipantContext extends InstanceContext { /** * Initialize the InteractionChannelParticipantContext * * @param Version $version Version that contains the resource * @param string $interactionSid The Interaction Sid for this channel. * @param string $channelSid The Channel Sid for this Participant. * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $interactionSid, $channelSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['interactionSid' => $interactionSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Interactions/' . \rawurlencode($interactionSid) . '/Channels/' . \rawurlencode($channelSid) . '/Participants/' . \rawurlencode($sid) . ''; } /** * Update the InteractionChannelParticipantInstance * * @param string $status The Participant's status. * @return InteractionChannelParticipantInstance Updated * InteractionChannelParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status): InteractionChannelParticipantInstance { $data = Values::of(['Status' => $status, ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } FlexApi/V1/Interaction/InteractionChannelPage.php 0000644 00000002371 15107452340 0015723 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1\Interaction; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class InteractionChannelPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } FlexApi/V1/Interaction/InteractionChannelOptions.php 0000644 00000002773 15107452340 0016510 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1\Interaction; use Twilio\Options; use Twilio\Values; abstract class InteractionChannelOptions { /** * @param array $routing Optional. The state of associated tasks. * @return UpdateInteractionChannelOptions Options builder */ public static function update(array $routing = Values::ARRAY_NONE): UpdateInteractionChannelOptions { return new UpdateInteractionChannelOptions($routing); } } class UpdateInteractionChannelOptions extends Options { /** * @param array $routing Optional. The state of associated tasks. */ public function __construct(array $routing = Values::ARRAY_NONE) { $this->options['routing'] = $routing; } /** * Optional. The state of associated tasks. If not specified, all tasks will be set to `wrapping`. * * @param array $routing Optional. The state of associated tasks. * @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 . ']'; } } FlexApi/V1/Interaction/InteractionChannelContext.php 0000644 00000012153 15107452340 0016472 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1\Interaction; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\FlexApi\V1\Interaction\InteractionChannel\InteractionChannelInviteList; use Twilio\Rest\FlexApi\V1\Interaction\InteractionChannel\InteractionChannelParticipantList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property InteractionChannelInviteList $invites * @property InteractionChannelParticipantList $participants * @method \Twilio\Rest\FlexApi\V1\Interaction\InteractionChannel\InteractionChannelParticipantContext participants(string $sid) */ class InteractionChannelContext extends InstanceContext { protected $_invites; protected $_participants; /** * Initialize the InteractionChannelContext * * @param Version $version Version that contains the resource * @param string $interactionSid The unique string that identifies the resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $interactionSid, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); return new InteractionChannelInstance( $this->version, $payload, $this->solution['interactionSid'], $this->solution['sid'] ); } /** * Update the InteractionChannelInstance * * @param string $status Required. The Interaction channels's 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']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new InteractionChannelInstance( $this->version, $payload, $this->solution['interactionSid'], $this->solution['sid'] ); } /** * 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; } /** * 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; } /** * 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) . ']'; } } FlexApi/V1/Interaction/InteractionChannelInstance.php 0000644 00000011224 15107452340 0016610 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1\Interaction; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\FlexApi\V1\Interaction\InteractionChannel\InteractionChannelInviteList; use Twilio\Rest\FlexApi\V1\Interaction\InteractionChannel\InteractionChannelParticipantList; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $interactionSid * @property string $type * @property string $status * @property int $errorCode * @property string $errorMessage * @property string $url * @property array $links */ class InteractionChannelInstance extends InstanceResource { protected $_invites; protected $_participants; /** * Initialize the InteractionChannelInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $interactionSid The unique string that identifies the resource. * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $interactionSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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 Required. The Interaction channels's 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 invites */ protected function getInvites(): InteractionChannelInviteList { return $this->proxy()->invites; } /** * Access the participants */ protected function getParticipants(): InteractionChannelParticipantList { 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.FlexApi.V1.InteractionChannelInstance ' . \implode(' ', $context) . ']'; } } FlexApi/V1/InsightsSettingsCommentOptions.php 0000644 00000003121 15107452340 0015301 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class InsightsSettingsCommentOptions { /** * @param string $token The Token HTTP request header * @return FetchInsightsSettingsCommentOptions Options builder */ public static function fetch(string $token = Values::NONE): FetchInsightsSettingsCommentOptions { return new FetchInsightsSettingsCommentOptions($token); } } class FetchInsightsSettingsCommentOptions extends Options { /** * @param string $token The Token HTTP request header */ public function __construct(string $token = Values::NONE) { $this->options['token'] = $token; } /** * The Token HTTP request header * * @param string $token The Token HTTP request header * @return $this Fluent Builder */ public function setToken(string $token): self { $this->options['token'] = $token; return $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 . ']'; } } FlexApi/V1/AssessmentsContext.php 0000644 00000004344 15107452340 0012756 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AssessmentsContext extends InstanceContext { /** * Initialize the AssessmentsContext * * @param Version $version Version that contains the resource * @param string $assessmentId Assessment Id */ public function __construct(Version $version, $assessmentId) { parent::__construct($version); // Path Solution $this->solution = ['assessmentId' => $assessmentId, ]; $this->uri = '/Insights/QM/Assessments/' . \rawurlencode($assessmentId) . ''; } /** * Update the AssessmentsInstance * * @param string $offset offset * @param string $answerText Answer text * @param string $answerId Answer Id * @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(['Token' => $options['token'], ]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new AssessmentsInstance($this->version, $payload, $this->solution['assessmentId']); } /** * Provide 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) . ']'; } } FlexApi/V1/InsightsAssessmentsCommentOptions.php 0000644 00000007274 15107452340 0016026 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class InsightsAssessmentsCommentOptions { /** * @param string $token The Token HTTP request header * @return CreateInsightsAssessmentsCommentOptions Options builder */ public static function create(string $token = Values::NONE): CreateInsightsAssessmentsCommentOptions { return new CreateInsightsAssessmentsCommentOptions($token); } /** * @param string $segmentId Segment Id. * @param string $agentId Agent Id. * @param string $token The Token HTTP request header * @return ReadInsightsAssessmentsCommentOptions Options builder */ public static function read(string $segmentId = Values::NONE, string $agentId = Values::NONE, string $token = Values::NONE): ReadInsightsAssessmentsCommentOptions { return new ReadInsightsAssessmentsCommentOptions($segmentId, $agentId, $token); } } class CreateInsightsAssessmentsCommentOptions extends Options { /** * @param string $token The Token HTTP request header */ public function __construct(string $token = Values::NONE) { $this->options['token'] = $token; } /** * The Token HTTP request header * * @param string $token The Token HTTP request header * @return $this Fluent Builder */ public function setToken(string $token): self { $this->options['token'] = $token; return $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 Segment Id. * @param string $agentId Agent Id. * @param string $token The Token HTTP request header */ public function __construct(string $segmentId = Values::NONE, string $agentId = Values::NONE, string $token = Values::NONE) { $this->options['segmentId'] = $segmentId; $this->options['agentId'] = $agentId; $this->options['token'] = $token; } /** * The id of the segment. * * @param string $segmentId Segment Id. * @return $this Fluent Builder */ public function setSegmentId(string $segmentId): self { $this->options['segmentId'] = $segmentId; return $this; } /** * The id of the agent. * * @param string $agentId Agent Id. * @return $this Fluent Builder */ public function setAgentId(string $agentId): self { $this->options['agentId'] = $agentId; return $this; } /** * The Token HTTP request header * * @param string $token The Token HTTP request header * @return $this Fluent Builder */ public function setToken(string $token): self { $this->options['token'] = $token; return $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 . ']'; } } FlexApi/V1/InsightsQuestionnairesOptions.php 0000644 00000024100 15107452340 0015167 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class InsightsQuestionnairesOptions { /** * @param string $description The questionnaire description * @param bool $active Is questionnaire enabled ? * @param string[] $questionIds The questionnaire question ids list * @param string $token The Token HTTP request header * @return CreateInsightsQuestionnairesOptions Options builder */ public static function create(string $description = Values::NONE, bool $active = Values::NONE, array $questionIds = Values::ARRAY_NONE, string $token = Values::NONE): CreateInsightsQuestionnairesOptions { return new CreateInsightsQuestionnairesOptions($description, $active, $questionIds, $token); } /** * @param bool $includeInactive Include Inactive * @param string $token The Token HTTP request header * @return ReadInsightsQuestionnairesOptions Options builder */ public static function read(bool $includeInactive = Values::NONE, string $token = Values::NONE): ReadInsightsQuestionnairesOptions { return new ReadInsightsQuestionnairesOptions($includeInactive, $token); } /** * @param string $name The questionnaire name * @param string $description The questionnaire description * @param string[] $questionIds The questionnaire question ids list * @param string $token The Token HTTP request header * @return UpdateInsightsQuestionnairesOptions Options builder */ public static function update(string $name = Values::NONE, string $description = Values::NONE, array $questionIds = Values::ARRAY_NONE, string $token = Values::NONE): UpdateInsightsQuestionnairesOptions { return new UpdateInsightsQuestionnairesOptions($name, $description, $questionIds, $token); } /** * @param string $token The Token HTTP request header * @return DeleteInsightsQuestionnairesOptions Options builder */ public static function delete(string $token = Values::NONE): DeleteInsightsQuestionnairesOptions { return new DeleteInsightsQuestionnairesOptions($token); } /** * @param string $token The Token HTTP request header * @return FetchInsightsQuestionnairesOptions Options builder */ public static function fetch(string $token = Values::NONE): FetchInsightsQuestionnairesOptions { return new FetchInsightsQuestionnairesOptions($token); } } class CreateInsightsQuestionnairesOptions extends Options { /** * @param string $description The questionnaire description * @param bool $active Is questionnaire enabled ? * @param string[] $questionIds The questionnaire question ids list * @param string $token The Token HTTP request header */ public function __construct(string $description = Values::NONE, bool $active = Values::NONE, array $questionIds = Values::ARRAY_NONE, string $token = Values::NONE) { $this->options['description'] = $description; $this->options['active'] = $active; $this->options['questionIds'] = $questionIds; $this->options['token'] = $token; } /** * The description of this questionnaire * * @param string $description The questionnaire description * @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 Is questionnaire enabled ? * @return $this Fluent Builder */ public function setActive(bool $active): self { $this->options['active'] = $active; return $this; } /** * The list of questions ids under a questionnaire * * @param string[] $questionIds The questionnaire question ids list * @return $this Fluent Builder */ public function setQuestionIds(array $questionIds): self { $this->options['questionIds'] = $questionIds; return $this; } /** * The Token HTTP request header * * @param string $token The Token HTTP request header * @return $this Fluent Builder */ public function setToken(string $token): self { $this->options['token'] = $token; return $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 ReadInsightsQuestionnairesOptions extends Options { /** * @param bool $includeInactive Include Inactive * @param string $token The Token HTTP request header */ public function __construct(bool $includeInactive = Values::NONE, string $token = Values::NONE) { $this->options['includeInactive'] = $includeInactive; $this->options['token'] = $token; } /** * Flag indicating whether to include inactive questionnaires or not * * @param bool $includeInactive Include Inactive * @return $this Fluent Builder */ public function setIncludeInactive(bool $includeInactive): self { $this->options['includeInactive'] = $includeInactive; return $this; } /** * The Token HTTP request header * * @param string $token The Token HTTP request header * @return $this Fluent Builder */ public function setToken(string $token): self { $this->options['token'] = $token; return $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 questionnaire name * @param string $description The questionnaire description * @param string[] $questionIds The questionnaire question ids list * @param string $token The Token HTTP request header */ public function __construct(string $name = Values::NONE, string $description = Values::NONE, array $questionIds = Values::ARRAY_NONE, string $token = Values::NONE) { $this->options['name'] = $name; $this->options['description'] = $description; $this->options['questionIds'] = $questionIds; $this->options['token'] = $token; } /** * The name of this questionnaire * * @param string $name The questionnaire name * @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 questionnaire description * @return $this Fluent Builder */ public function setDescription(string $description): self { $this->options['description'] = $description; return $this; } /** * The list of questions ids under a questionnaire * * @param string[] $questionIds The questionnaire question ids list * @return $this Fluent Builder */ public function setQuestionIds(array $questionIds): self { $this->options['questionIds'] = $questionIds; return $this; } /** * The Token HTTP request header * * @param string $token The Token HTTP request header * @return $this Fluent Builder */ public function setToken(string $token): self { $this->options['token'] = $token; return $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 . ']'; } } class DeleteInsightsQuestionnairesOptions extends Options { /** * @param string $token The Token HTTP request header */ public function __construct(string $token = Values::NONE) { $this->options['token'] = $token; } /** * The Token HTTP request header * * @param string $token The Token HTTP request header * @return $this Fluent Builder */ public function setToken(string $token): self { $this->options['token'] = $token; return $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 $token The Token HTTP request header */ public function __construct(string $token = Values::NONE) { $this->options['token'] = $token; } /** * The Token HTTP request header * * @param string $token The Token HTTP request header * @return $this Fluent Builder */ public function setToken(string $token): self { $this->options['token'] = $token; return $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 . ']'; } } FlexApi/V1/InsightsAssessmentsCommentPage.php 0000644 00000002671 15107452340 0015243 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class InsightsAssessmentsCommentPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } FlexApi/V1/FlexFlowPage.php 0000644 00000002202 15107452340 0011413 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class FlexFlowPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } FlexApi/V1/InteractionList.php 0000644 00000003432 15107452340 0012211 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class InteractionList extends ListResource { /** * Construct the InteractionList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Interactions'; } /** * Create the InteractionInstance * * @param array $channel The Interaction's channel * @param array $routing The Interaction's routing logic * @return InteractionInstance Created InteractionInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $channel, array $routing): InteractionInstance { $data = Values::of([ 'Channel' => Serialize::jsonObject($channel), 'Routing' => Serialize::jsonObject($routing), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new InteractionInstance($this->version, $payload); } /** * Constructs a InteractionContext * * @param string $sid The SID that identifies the 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]'; } } FlexApi/V1/InsightsSessionInstance.php 0000644 00000006315 15107452340 0013722 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $workspaceId * @property string $sessionExpiry * @property string $sessionId * @property string $baseUrl * @property string $url */ class InsightsSessionInstance extends InstanceResource { /** * Initialize the InsightsSessionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } FlexApi/V1/InsightsQuestionnairesCategoryList.php 0000644 00000014761 15107452340 0016161 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class InsightsQuestionnairesCategoryList extends ListResource { /** * Construct the InsightsQuestionnairesCategoryList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Insights/QM/Categories'; } /** * Create the InsightsQuestionnairesCategoryInstance * * @param string $name The category name. * @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(['Token' => $options['token'], ]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new InsightsQuestionnairesCategoryInstance($this->version, $payload); } /** * 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 array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will 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']); } /** * 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 array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined 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(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of InsightsQuestionnairesCategoryInstance records * from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return InsightsQuestionnairesCategoryPage Page of * InsightsQuestionnairesCategoryInstance */ public function page(array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): InsightsQuestionnairesCategoryPage { $options = new Values($options); $params = Values::of(['PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $headers = Values::of(['Token' => $options['token'], ]); $response = $this->version->page('GET', $this->uri, $params, [], $headers); 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 $categoryId Category ID to update */ public function getContext(string $categoryId): InsightsQuestionnairesCategoryContext { return new InsightsQuestionnairesCategoryContext($this->version, $categoryId); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.FlexApi.V1.InsightsQuestionnairesCategoryList]'; } } FlexApi/V1/InsightsUserRolesOptions.php 0000644 00000003255 15107452340 0014111 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class InsightsUserRolesOptions { /** * @param string $authorization The Authorization HTTP request header * @return FetchInsightsUserRolesOptions Options builder */ public static function fetch(string $authorization = Values::NONE): FetchInsightsUserRolesOptions { return new FetchInsightsUserRolesOptions($authorization); } } class FetchInsightsUserRolesOptions 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.FetchInsightsUserRolesOptions ' . $options . ']'; } } FlexApi/V1/InsightsQuestionnairesCategoryContext.php 0000644 00000005446 15107452340 0016672 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class InsightsQuestionnairesCategoryContext extends InstanceContext { /** * Initialize the InsightsQuestionnairesCategoryContext * * @param Version $version Version that contains the resource * @param string $categoryId Category ID to update */ public function __construct(Version $version, $categoryId) { parent::__construct($version); // Path Solution $this->solution = ['categoryId' => $categoryId, ]; $this->uri = '/Insights/QM/Categories/' . \rawurlencode($categoryId) . ''; } /** * Update the InsightsQuestionnairesCategoryInstance * * @param string $name The category name. * @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(['Token' => $options['token'], ]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new InsightsQuestionnairesCategoryInstance( $this->version, $payload, $this->solution['categoryId'] ); } /** * 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(['Token' => $options['token'], ]); 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.FlexApi.V1.InsightsQuestionnairesCategoryContext ' . \implode(' ', $context) . ']'; } } FlexApi/V1/ConfigurationOptions.php 0000644 00000003127 15107452340 0013262 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Options; use Twilio\Values; abstract class ConfigurationOptions { /** * @param string $uiVersion The Pinned UI version of the Configuration resource * to fetch * @return FetchConfigurationOptions Options builder */ public static function fetch(string $uiVersion = Values::NONE): FetchConfigurationOptions { return new FetchConfigurationOptions($uiVersion); } } class FetchConfigurationOptions extends Options { /** * @param string $uiVersion The Pinned UI version of the Configuration resource * to fetch */ public function __construct(string $uiVersion = Values::NONE) { $this->options['uiVersion'] = $uiVersion; } /** * The Pinned UI version of the Configuration resource to fetch. * * @param string $uiVersion The Pinned UI version of the Configuration resource * to fetch * @return $this Fluent Builder */ public function setUiVersion(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 . ']'; } } FlexApi/V1/InsightsAssessmentsCommentList.php 0000644 00000015711 15107452340 0015301 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class InsightsAssessmentsCommentList extends ListResource { /** * Construct the InsightsAssessmentsCommentList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Insights/QM/Assessments/Comments'; } /** * Create the InsightsAssessmentsCommentInstance * * @param string $categoryId Category ID * @param string $categoryName Category name * @param string $comment The comment. * @param string $segmentId Segment Id. * @param string $userName The user name. * @param string $userEmail The user email id. * @param string $agentId Agent Id. * @param string $offset 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 $userName, string $userEmail, string $agentId, string $offset, array $options = []): InsightsAssessmentsCommentInstance { $options = new Values($options); $data = Values::of([ 'CategoryId' => $categoryId, 'CategoryName' => $categoryName, 'Comment' => $comment, 'SegmentId' => $segmentId, 'UserName' => $userName, 'UserEmail' => $userEmail, 'AgentId' => $agentId, 'Offset' => $offset, ]); $headers = Values::of(['Token' => $options['token'], ]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new InsightsAssessmentsCommentInstance($this->version, $payload); } /** * 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']); } /** * 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); } /** * Retrieve a single page of InsightsAssessmentsCommentInstance records from * the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $headers = Values::of(['Token' => $options['token'], ]); $response = $this->version->page('GET', $this->uri, $params, [], $headers); 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]'; } } FlexApi/V1/InteractionPage.php 0000644 00000002224 15107452340 0012150 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class InteractionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } FlexApi/V1.php 0000644 00000020554 15107452340 0007102 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\FlexApi\V1\AssessmentsList; use Twilio\Rest\FlexApi\V1\ChannelList; use Twilio\Rest\FlexApi\V1\ConfigurationList; use Twilio\Rest\FlexApi\V1\FlexFlowList; use Twilio\Rest\FlexApi\V1\InsightsAssessmentsCommentList; use Twilio\Rest\FlexApi\V1\InsightsQuestionnairesCategoryList; use Twilio\Rest\FlexApi\V1\InsightsQuestionnairesList; use Twilio\Rest\FlexApi\V1\InsightsQuestionnairesQuestionList; use Twilio\Rest\FlexApi\V1\InsightsSegmentsList; use Twilio\Rest\FlexApi\V1\InsightsSessionList; use Twilio\Rest\FlexApi\V1\InsightsSettingsAnswerSetsList; use Twilio\Rest\FlexApi\V1\InsightsSettingsCommentList; use Twilio\Rest\FlexApi\V1\InsightsUserRolesList; use Twilio\Rest\FlexApi\V1\InteractionList; use Twilio\Rest\FlexApi\V1\WebChannelList; use Twilio\Version; /** * @property ChannelList $channel * @property ConfigurationList $configuration * @property FlexFlowList $flexFlow * @property AssessmentsList $assessments * @property InsightsAssessmentsCommentList $insightsAssessmentsComment * @property InsightsQuestionnairesList $insightsQuestionnaires * @property InsightsQuestionnairesCategoryList $insightsQuestionnairesCategory * @property InsightsQuestionnairesQuestionList $insightsQuestionnairesQuestion * @property InsightsSegmentsList $insightsSegments * @property InsightsSessionList $insightsSession * @property InsightsSettingsAnswerSetsList $insightsSettingsAnswerSets * @property InsightsSettingsCommentList $insightsSettingsComment * @property InsightsUserRolesList $insightsUserRoles * @property InteractionList $interaction * @property WebChannelList $webChannel * @method \Twilio\Rest\FlexApi\V1\ChannelContext channel(string $sid) * @method \Twilio\Rest\FlexApi\V1\FlexFlowContext flexFlow(string $sid) * @method \Twilio\Rest\FlexApi\V1\AssessmentsContext assessments(string $assessmentId) * @method \Twilio\Rest\FlexApi\V1\InsightsQuestionnairesContext insightsQuestionnaires(string $id) * @method \Twilio\Rest\FlexApi\V1\InsightsQuestionnairesCategoryContext insightsQuestionnairesCategory(string $categoryId) * @method \Twilio\Rest\FlexApi\V1\InsightsQuestionnairesQuestionContext insightsQuestionnairesQuestion(string $questionId) * @method \Twilio\Rest\FlexApi\V1\InsightsSegmentsContext insightsSegments(string $segmentId) * @method \Twilio\Rest\FlexApi\V1\InteractionContext interaction(string $sid) * @method \Twilio\Rest\FlexApi\V1\WebChannelContext webChannel(string $sid) */ class V1 extends Version { protected $_channel; protected $_configuration; protected $_flexFlow; protected $_assessments; protected $_insightsAssessmentsComment; protected $_insightsQuestionnaires; protected $_insightsQuestionnairesCategory; protected $_insightsQuestionnairesQuestion; protected $_insightsSegments; protected $_insightsSession; protected $_insightsSettingsAnswerSets; protected $_insightsSettingsComment; protected $_insightsUserRoles; protected $_interaction; protected $_webChannel; /** * Construct the V1 version of FlexApi * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } 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 getAssessments(): AssessmentsList { if (!$this->_assessments) { $this->_assessments = new AssessmentsList($this); } return $this->_assessments; } protected function getInsightsAssessmentsComment(): InsightsAssessmentsCommentList { if (!$this->_insightsAssessmentsComment) { $this->_insightsAssessmentsComment = new InsightsAssessmentsCommentList($this); } return $this->_insightsAssessmentsComment; } 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 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]'; } } FlexApi/V2/WebChannelsList.php 0000644 00000003304 15107452341 0012123 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V2; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class WebChannelsList extends ListResource { /** * Construct the WebChannelsList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/WebChats'; } /** * Create the WebChannelsInstance * * @param string $addressSid The SID of the Conversations Address * @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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new WebChannelsInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.FlexApi.V2.WebChannelsList]'; } } FlexApi/V2/WebChannelsOptions.php 0000644 00000006260 15107452341 0012647 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V2; use Twilio\Options; use Twilio\Values; abstract class WebChannelsOptions { /** * @param string $chatFriendlyName The Conversation's friendly name * @param string $customerFriendlyName The Conversation participant's friendly * name * @param string $preEngagementData The pre-engagement data * @return CreateWebChannelsOptions Options builder */ public static function create(string $chatFriendlyName = Values::NONE, string $customerFriendlyName = Values::NONE, string $preEngagementData = Values::NONE): CreateWebChannelsOptions { return new CreateWebChannelsOptions($chatFriendlyName, $customerFriendlyName, $preEngagementData); } } class CreateWebChannelsOptions extends Options { /** * @param string $chatFriendlyName The Conversation's friendly name * @param string $customerFriendlyName The Conversation participant's friendly * name * @param string $preEngagementData The pre-engagement data */ public function __construct(string $chatFriendlyName = Values::NONE, string $customerFriendlyName = Values::NONE, string $preEngagementData = Values::NONE) { $this->options['chatFriendlyName'] = $chatFriendlyName; $this->options['customerFriendlyName'] = $customerFriendlyName; $this->options['preEngagementData'] = $preEngagementData; } /** * 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 * @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 * @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; } /** * 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 . ']'; } } FlexApi/V2/WebChannelsInstance.php 0000644 00000003325 15107452341 0012757 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $conversationSid * @property string $identity */ class WebChannelsInstance extends InstanceResource { /** * Initialize the WebChannelsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->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]'; } } FlexApi/V2/WebChannelsPage.php 0000644 00000002224 15107452341 0012064 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V2; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class WebChannelsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } FlexApi/V2.php 0000644 00000004177 15107452341 0007107 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\FlexApi\V2\WebChannelsList; use Twilio\Version; /** * @property WebChannelsList $webChannels */ class V2 extends Version { protected $_webChannels; /** * Construct the V2 version of FlexApi * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v2'; } 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]'; } } Oauth/V1/UserInfoList.php 0000644 00000001577 15107452341 0011225 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Oauth\V1; use Twilio\ListResource; use Twilio\Version; class UserInfoList extends ListResource { /** * Construct the UserInfoList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; } /** * Constructs a UserInfoContext */ public function getContext(): UserInfoContext { return new UserInfoContext($this->version); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Oauth.V1.UserInfoList]'; } } Oauth/V1/OpenidDiscoveryPage.php 0000644 00000002246 15107452341 0012534 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Oauth\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class OpenidDiscoveryPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return OpenidDiscoveryInstance \Twilio\Rest\Oauth\V1\OpenidDiscoveryInstance */ public function buildInstance(array $payload): OpenidDiscoveryInstance { return new OpenidDiscoveryInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Oauth.V1.OpenidDiscoveryPage]'; } } Oauth/V1/UserInfoInstance.php 0000644 00000005630 15107452341 0012050 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Oauth\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $userSid * @property string $firstName * @property string $lastName * @property string $friendlyName * @property string $email * @property string $url */ class UserInfoInstance extends InstanceResource { /** * Initialize the UserInfoInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'userSid' => Values::array_get($payload, 'user_sid'), 'firstName' => Values::array_get($payload, 'first_name'), 'lastName' => Values::array_get($payload, 'last_name'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'email' => Values::array_get($payload, 'email'), '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 UserInfoContext Context for this UserInfoInstance */ protected function proxy(): UserInfoContext { if (!$this->context) { $this->context = new UserInfoContext($this->version); } return $this->context; } /** * Fetch the UserInfoInstance * * @return UserInfoInstance Fetched UserInfoInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserInfoInstance { 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.Oauth.V1.UserInfoInstance ' . \implode(' ', $context) . ']'; } } Oauth/V1/DeviceCodeInstance.php 0000644 00000004212 15107452341 0012303 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Oauth\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $deviceCode * @property string $userCode * @property string $verificationUri * @property string $verificationUriComplete * @property string $expiresIn * @property int $interval */ class DeviceCodeInstance extends InstanceResource { /** * Initialize the DeviceCodeInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'deviceCode' => Values::array_get($payload, 'device_code'), 'userCode' => Values::array_get($payload, 'user_code'), 'verificationUri' => Values::array_get($payload, 'verification_uri'), 'verificationUriComplete' => Values::array_get($payload, 'verification_uri_complete'), 'expiresIn' => Values::array_get($payload, 'expires_in'), 'interval' => Values::array_get($payload, 'interval'), ]; $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.DeviceCodeInstance]'; } } Oauth/V1/DeviceCodePage.php 0000644 00000002210 15107452341 0011407 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Oauth\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class DeviceCodePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return DeviceCodeInstance \Twilio\Rest\Oauth\V1\DeviceCodeInstance */ public function buildInstance(array $payload): DeviceCodeInstance { return new DeviceCodeInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Oauth.V1.DeviceCodePage]'; } } Oauth/V1/OauthInstance.php 0000644 00000004737 15107452341 0011405 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Oauth\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property array $keys * @property string $url */ class OauthInstance extends InstanceResource { /** * Initialize the OauthInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'keys' => Values::array_get($payload, 'keys'), '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 OauthContext Context for this OauthInstance */ protected function proxy(): OauthContext { if (!$this->context) { $this->context = new OauthContext($this->version); } return $this->context; } /** * Fetch the OauthInstance * * @return OauthInstance Fetched OauthInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): OauthInstance { 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.Oauth.V1.OauthInstance ' . \implode(' ', $context) . ']'; } } Oauth/V1/OauthContext.php 0000644 00000002455 15107452341 0011260 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Oauth\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class OauthContext extends InstanceContext { /** * Initialize the OauthContext * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/certs'; } /** * Fetch the OauthInstance * * @return OauthInstance Fetched OauthInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): OauthInstance { $payload = $this->version->fetch('GET', $this->uri); return new OauthInstance($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.Oauth.V1.OauthContext ' . \implode(' ', $context) . ']'; } } Oauth/V1/TokenList.php 0000644 00000003667 15107452341 0010555 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Oauth\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class TokenList extends ListResource { /** * Construct the TokenList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/token'; } /** * Create the TokenInstance * * @param string $grantType A way of representing resource owner's to obtain * access token * @param string $clientSid A 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 $clientSid, array $options = []): TokenInstance { $options = new Values($options); $data = Values::of([ 'GrantType' => $grantType, 'ClientSid' => $clientSid, 'ClientSecret' => $options['clientSecret'], 'Code' => $options['code'], 'CodeVerifier' => $options['codeVerifier'], 'DeviceCode' => $options['deviceCode'], 'RefreshToken' => $options['refreshToken'], 'DeviceId' => $options['deviceId'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new TokenInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Oauth.V1.TokenList]'; } } Oauth/V1/TokenOptions.php 0000644 00000010033 15107452341 0011256 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Oauth\V1; use Twilio\Options; use Twilio\Values; abstract class TokenOptions { /** * @param string $clientSecret The credential for confidential OAuth App * @param string $code Jwt token * @param string $codeVerifier The cryptographically generated code * @param string $deviceCode Jwt token * @param string $refreshToken Jwt token * @param string $deviceId An Id of device * @return CreateTokenOptions Options builder */ public static function create(string $clientSecret = Values::NONE, string $code = Values::NONE, string $codeVerifier = Values::NONE, string $deviceCode = Values::NONE, string $refreshToken = Values::NONE, string $deviceId = Values::NONE): CreateTokenOptions { return new CreateTokenOptions($clientSecret, $code, $codeVerifier, $deviceCode, $refreshToken, $deviceId); } } class CreateTokenOptions extends Options { /** * @param string $clientSecret The credential for confidential OAuth App * @param string $code Jwt token * @param string $codeVerifier The cryptographically generated code * @param string $deviceCode Jwt token * @param string $refreshToken Jwt token * @param string $deviceId An Id of device */ public function __construct(string $clientSecret = Values::NONE, string $code = Values::NONE, string $codeVerifier = Values::NONE, string $deviceCode = Values::NONE, string $refreshToken = Values::NONE, string $deviceId = Values::NONE) { $this->options['clientSecret'] = $clientSecret; $this->options['code'] = $code; $this->options['codeVerifier'] = $codeVerifier; $this->options['deviceCode'] = $deviceCode; $this->options['refreshToken'] = $refreshToken; $this->options['deviceId'] = $deviceId; } /** * 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 * @return $this Fluent Builder */ public function setCode(string $code): self { $this->options['code'] = $code; return $this; } /** * A code which is generation cryptographically. * * @param string $codeVerifier The cryptographically generated code * @return $this Fluent Builder */ public function setCodeVerifier(string $codeVerifier): self { $this->options['codeVerifier'] = $codeVerifier; return $this; } /** * JWT token related to the device code grant type. * * @param string $deviceCode Jwt token * @return $this Fluent Builder */ public function setDeviceCode(string $deviceCode): self { $this->options['deviceCode'] = $deviceCode; return $this; } /** * JWT token related to the refresh token grant type. * * @param string $refreshToken Jwt token * @return $this Fluent Builder */ public function setRefreshToken(string $refreshToken): self { $this->options['refreshToken'] = $refreshToken; return $this; } /** * The Id of the device associated with the token (refresh token). * * @param string $deviceId An Id of device * @return $this Fluent Builder */ public function setDeviceId(string $deviceId): self { $this->options['deviceId'] = $deviceId; return $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 . ']'; } } Oauth/V1/TokenPage.php 0000644 00000002152 15107452341 0010502 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Oauth\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class TokenPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Oauth/V1/OpenidDiscoveryList.php 0000644 00000001651 15107452341 0012572 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Oauth\V1; use Twilio\ListResource; use Twilio\Version; class OpenidDiscoveryList extends ListResource { /** * Construct the OpenidDiscoveryList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; } /** * Constructs a OpenidDiscoveryContext */ public function getContext(): OpenidDiscoveryContext { return new OpenidDiscoveryContext($this->version); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Oauth.V1.OpenidDiscoveryList]'; } } Oauth/V1/UserInfoContext.php 0000644 00000002510 15107452341 0011722 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Oauth\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class UserInfoContext extends InstanceContext { /** * Initialize the UserInfoContext * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/userinfo'; } /** * Fetch the UserInfoInstance * * @return UserInfoInstance Fetched UserInfoInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserInfoInstance { $payload = $this->version->fetch('GET', $this->uri); return new UserInfoInstance($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.Oauth.V1.UserInfoContext ' . \implode(' ', $context) . ']'; } } Oauth/V1/DeviceCodeOptions.php 0000644 00000002620 15107452341 0012173 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Oauth\V1; use Twilio\Options; use Twilio\Values; abstract class DeviceCodeOptions { /** * @param string[] $audiences An array of intended audiences * @return CreateDeviceCodeOptions Options builder */ public static function create(array $audiences = Values::ARRAY_NONE): CreateDeviceCodeOptions { return new CreateDeviceCodeOptions($audiences); } } class CreateDeviceCodeOptions extends Options { /** * @param string[] $audiences An array of intended audiences */ public function __construct(array $audiences = Values::ARRAY_NONE) { $this->options['audiences'] = $audiences; } /** * An array of intended audiences for token requests * * @param string[] $audiences An array of intended audiences * @return $this Fluent Builder */ public function setAudiences(array $audiences): self { $this->options['audiences'] = $audiences; return $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.CreateDeviceCodeOptions ' . $options . ']'; } } Oauth/V1/DeviceCodeList.php 0000644 00000003375 15107452341 0011463 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Oauth\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class DeviceCodeList extends ListResource { /** * Construct the DeviceCodeList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/device/code'; } /** * Create the DeviceCodeInstance * * @param string $clientSid A string that uniquely identifies this oauth app * @param string[] $scopes An Array of scopes * @param array|Options $options Optional Arguments * @return DeviceCodeInstance Created DeviceCodeInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $clientSid, array $scopes, array $options = []): DeviceCodeInstance { $options = new Values($options); $data = Values::of([ 'ClientSid' => $clientSid, 'Scopes' => Serialize::map($scopes, function($e) { return $e; }), 'Audiences' => Serialize::map($options['audiences'], function($e) { return $e; }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new DeviceCodeInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Oauth.V1.DeviceCodeList]'; } } Oauth/V1/OpenidDiscoveryContext.php 0000644 00000002630 15107452341 0013301 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Oauth\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class OpenidDiscoveryContext extends InstanceContext { /** * Initialize the OpenidDiscoveryContext * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/.well-known/openid-configuration'; } /** * Fetch the OpenidDiscoveryInstance * * @return OpenidDiscoveryInstance Fetched OpenidDiscoveryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): OpenidDiscoveryInstance { $payload = $this->version->fetch('GET', $this->uri); return new OpenidDiscoveryInstance($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.Oauth.V1.OpenidDiscoveryContext ' . \implode(' ', $context) . ']'; } } Oauth/V1/OauthPage.php 0000644 00000002152 15107452341 0010502 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Oauth\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class OauthPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return OauthInstance \Twilio\Rest\Oauth\V1\OauthInstance */ public function buildInstance(array $payload): OauthInstance { return new OauthInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Oauth.V1.OauthPage]'; } } Oauth/V1/TokenInstance.php 0000644 00000004176 15107452341 0011402 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Oauth\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accessToken * @property string $refreshToken * @property string $idToken * @property \DateTime $refreshTokenExpiresAt * @property \DateTime $accessTokenExpiresAt */ class TokenInstance extends InstanceResource { /** * Initialize the TokenInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accessToken' => Values::array_get($payload, 'access_token'), 'refreshToken' => Values::array_get($payload, 'refresh_token'), 'idToken' => Values::array_get($payload, 'id_token'), 'refreshTokenExpiresAt' => Deserialize::dateTime(Values::array_get($payload, 'refresh_token_expires_at')), 'accessTokenExpiresAt' => Deserialize::dateTime(Values::array_get($payload, 'access_token_expires_at')), ]; $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]'; } } Oauth/V1/UserInfoPage.php 0000644 00000002174 15107452341 0011160 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Oauth\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UserInfoPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return UserInfoInstance \Twilio\Rest\Oauth\V1\UserInfoInstance */ public function buildInstance(array $payload): UserInfoInstance { return new UserInfoInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Oauth.V1.UserInfoPage]'; } } Oauth/V1/OauthList.php 0000644 00000001555 15107452341 0010547 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Oauth\V1; use Twilio\ListResource; use Twilio\Version; class OauthList extends ListResource { /** * Construct the OauthList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; } /** * Constructs a OauthContext */ public function getContext(): OauthContext { return new OauthContext($this->version); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Oauth.V1.OauthList]'; } } Oauth/V1/OpenidDiscoveryInstance.php 0000644 00000007767 15107452341 0013441 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Oauth\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $issuer * @property string $authorizationEndpoint * @property string $deviceAuthorizationEndpoint * @property string $tokenEndpoint * @property string $userinfoEndpoint * @property string $revocationEndpoint * @property string $jwkUri * @property string[] $responseTypeSupported * @property string[] $subjectTypeSupported * @property string[] $idTokenSigningAlgValuesSupported * @property string[] $scopesSupported * @property string[] $claimsSupported * @property string $url */ class OpenidDiscoveryInstance extends InstanceResource { /** * Initialize the OpenidDiscoveryInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'issuer' => Values::array_get($payload, 'issuer'), 'authorizationEndpoint' => Values::array_get($payload, 'authorization_endpoint'), 'deviceAuthorizationEndpoint' => Values::array_get($payload, 'device_authorization_endpoint'), 'tokenEndpoint' => Values::array_get($payload, 'token_endpoint'), 'userinfoEndpoint' => Values::array_get($payload, 'userinfo_endpoint'), 'revocationEndpoint' => Values::array_get($payload, 'revocation_endpoint'), 'jwkUri' => Values::array_get($payload, 'jwk_uri'), 'responseTypeSupported' => Values::array_get($payload, 'response_type_supported'), 'subjectTypeSupported' => Values::array_get($payload, 'subject_type_supported'), 'idTokenSigningAlgValuesSupported' => Values::array_get($payload, 'id_token_signing_alg_values_supported'), 'scopesSupported' => Values::array_get($payload, 'scopes_supported'), 'claimsSupported' => Values::array_get($payload, 'claims_supported'), '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 OpenidDiscoveryContext Context for this OpenidDiscoveryInstance */ protected function proxy(): OpenidDiscoveryContext { if (!$this->context) { $this->context = new OpenidDiscoveryContext($this->version); } return $this->context; } /** * Fetch the OpenidDiscoveryInstance * * @return OpenidDiscoveryInstance Fetched OpenidDiscoveryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): OpenidDiscoveryInstance { 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.Oauth.V1.OpenidDiscoveryInstance ' . \implode(' ', $context) . ']'; } } Oauth/V1.php 0000644 00000006413 15107452341 0006631 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Oauth; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Oauth\V1\DeviceCodeList; use Twilio\Rest\Oauth\V1\OauthList; use Twilio\Rest\Oauth\V1\OpenidDiscoveryList; use Twilio\Rest\Oauth\V1\TokenList; use Twilio\Rest\Oauth\V1\UserInfoList; use Twilio\Version; /** * @property OauthList $oauth * @property DeviceCodeList $deviceCode * @property OpenidDiscoveryList $openidDiscovery * @property TokenList $token * @property UserInfoList $userInfo */ class V1 extends Version { protected $_oauth; protected $_deviceCode; protected $_openidDiscovery; protected $_token; protected $_userInfo; /** * Construct the V1 version of Oauth * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } protected function getOauth(): OauthList { if (!$this->_oauth) { $this->_oauth = new OauthList($this); } return $this->_oauth; } protected function getDeviceCode(): DeviceCodeList { if (!$this->_deviceCode) { $this->_deviceCode = new DeviceCodeList($this); } return $this->_deviceCode; } protected function getOpenidDiscovery(): OpenidDiscoveryList { if (!$this->_openidDiscovery) { $this->_openidDiscovery = new OpenidDiscoveryList($this); } return $this->_openidDiscovery; } protected function getToken(): TokenList { if (!$this->_token) { $this->_token = new TokenList($this); } return $this->_token; } protected function getUserInfo(): UserInfoList { if (!$this->_userInfo) { $this->_userInfo = new UserInfoList($this); } return $this->_userInfo; } /** * 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]'; } } Studio/V1/FlowPage.php 0000644 00000002147 15107452341 0010524 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class FlowPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Studio/V1/FlowInstance.php 0000644 00000010103 15107452341 0011403 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Rest\Studio\V1\Flow\EngagementList; use Twilio\Rest\Studio\V1\Flow\ExecutionList; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $friendlyName * @property string $status * @property int $version * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class FlowInstance extends InstanceResource { protected $_engagements; protected $_executions; /** * Initialize the FlowInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the FlowInstance * * @return FlowInstance Fetched FlowInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FlowInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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) . ']'; } } Studio/V1/FlowContext.php 0000644 00000007426 15107452342 0011302 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Studio\V1\Flow\EngagementList; use Twilio\Rest\Studio\V1\Flow\ExecutionList; use Twilio\Values; use Twilio\Version; /** * @property EngagementList $engagements * @property ExecutionList $executions * @method \Twilio\Rest\Studio\V1\Flow\EngagementContext engagements(string $sid) * @method \Twilio\Rest\Studio\V1\Flow\ExecutionContext executions(string $sid) */ class FlowContext extends InstanceContext { protected $_engagements; protected $_executions; /** * Initialize the FlowContext * * @param Version $version Version that contains the resource * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Flows/' . \rawurlencode($sid) . ''; } /** * Fetch the FlowInstance * * @return FlowInstance Fetched FlowInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FlowInstance { $payload = $this->version->fetch('GET', $this->uri); return new FlowInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the FlowInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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) . ']'; } } Studio/V1/FlowList.php 0000644 00000010677 15107452342 0010573 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class FlowList extends ListResource { /** * Construct the FlowList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Flows'; } /** * Streams FlowInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 that identifies the resource to fetch */ 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]'; } } Studio/V1/Flow/Engagement/EngagementContextInstance.php 0000644 00000006356 15107452342 0017114 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Engagement; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property array $context * @property string $engagementSid * @property string $flowSid * @property string $url */ class EngagementContextInstance extends InstanceResource { /** * Initialize the EngagementContextInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $flowSid Flow SID * @param string $engagementSid Engagement SID */ public function __construct(Version $version, array $payload, string $flowSid, string $engagementSid) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Studio/V1/Flow/Engagement/StepList.php 0000644 00000011561 15107452342 0013551 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Engagement; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class StepList extends ListResource { /** * Construct the StepList * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow * @param string $engagementSid The SID of the Engagement */ public function __construct(Version $version, string $flowSid, string $engagementSid) { parent::__construct($version); // Path Solution $this->solution = ['flowSid' => $flowSid, 'engagementSid' => $engagementSid, ]; $this->uri = '/Flows/' . \rawurlencode($flowSid) . '/Engagements/' . \rawurlencode($engagementSid) . '/Steps'; } /** * Streams StepInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 that identifies the 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]'; } } Studio/V1/Flow/Engagement/EngagementContextList.php 0000644 00000002357 15107452342 0016260 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Engagement; use Twilio\ListResource; use Twilio\Version; class EngagementContextList extends ListResource { /** * Construct the EngagementContextList * * @param Version $version Version that contains the resource * @param string $flowSid Flow SID * @param string $engagementSid Engagement SID */ public function __construct(Version $version, string $flowSid, string $engagementSid) { parent::__construct($version); // Path Solution $this->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]'; } } Studio/V1/Flow/Engagement/StepContext.php 0000644 00000007174 15107452342 0014267 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Engagement; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Studio\V1\Flow\Engagement\Step\StepContextList; use Twilio\Values; use Twilio\Version; /** * @property StepContextList $stepContext * @method \Twilio\Rest\Studio\V1\Flow\Engagement\Step\StepContextContext stepContext() */ class StepContext extends InstanceContext { protected $_stepContext; /** * Initialize the StepContext * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow * @param string $engagementSid The SID of the Engagement * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, $flowSid, $engagementSid, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Studio/V1/Flow/Engagement/StepInstance.php 0000644 00000010531 15107452342 0014376 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Engagement; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Rest\Studio\V1\Flow\Engagement\Step\StepContextList; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $flowSid * @property string $engagementSid * @property string $name * @property array $context * @property string $transitionedFrom * @property string $transitionedTo * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class StepInstance extends InstanceResource { protected $_stepContext; /** * Initialize the StepInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $flowSid The SID of the Flow * @param string $engagementSid The SID of the Engagement * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, array $payload, string $flowSid, string $engagementSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Studio/V1/Flow/Engagement/EngagementContextContext.php 0000644 00000003437 15107452342 0016771 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Engagement; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class EngagementContextContext extends InstanceContext { /** * Initialize the EngagementContextContext * * @param Version $version Version that contains the resource * @param string $flowSid Flow SID * @param string $engagementSid Engagement SID */ public function __construct(Version $version, $flowSid, $engagementSid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Studio/V1/Flow/Engagement/StepPage.php 0000644 00000002377 15107452342 0013517 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Engagement; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class StepPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Studio/V1/Flow/Engagement/Step/StepContextPage.php 0000644 00000002533 15107452342 0015771 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Engagement\Step; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class StepContextPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Studio/V1/Flow/Engagement/Step/StepContextList.php 0000644 00000002535 15107452342 0016032 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Engagement\Step; use Twilio\ListResource; use Twilio\Version; class StepContextList extends ListResource { /** * Construct the StepContextList * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow * @param string $engagementSid The SID of the Engagement * @param string $stepSid Step SID */ public function __construct(Version $version, string $flowSid, string $engagementSid, string $stepSid) { parent::__construct($version); // Path Solution $this->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]'; } } Studio/V1/Flow/Engagement/Step/StepContextInstance.php 0000644 00000006641 15107452342 0016665 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Engagement\Step; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property array $context * @property string $engagementSid * @property string $flowSid * @property string $stepSid * @property string $url */ class StepContextInstance extends InstanceResource { /** * Initialize the StepContextInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $flowSid The SID of the Flow * @param string $engagementSid The SID of the Engagement * @param string $stepSid Step SID */ public function __construct(Version $version, array $payload, string $flowSid, string $engagementSid, string $stepSid) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Studio/V1/Flow/Engagement/Step/StepContextContext.php 0000644 00000003640 15107452342 0016541 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Engagement\Step; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class StepContextContext extends InstanceContext { /** * Initialize the StepContextContext * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow * @param string $engagementSid The SID of the Engagement * @param string $stepSid Step SID */ public function __construct(Version $version, $flowSid, $engagementSid, $stepSid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Studio/V1/Flow/Engagement/EngagementContextPage.php 0000644 00000002515 15107452342 0016215 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Engagement; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class EngagementContextPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Studio/V1/Flow/EngagementContext.php 0000644 00000010302 15107452342 0013337 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Studio\V1\Flow\Engagement\EngagementContextList; use Twilio\Rest\Studio\V1\Flow\Engagement\StepList; use Twilio\Values; use Twilio\Version; /** * @property StepList $steps * @property EngagementContextList $engagementContext * @method \Twilio\Rest\Studio\V1\Flow\Engagement\StepContext steps(string $sid) * @method \Twilio\Rest\Studio\V1\Flow\Engagement\EngagementContextContext engagementContext() */ class EngagementContext extends InstanceContext { protected $_steps; protected $_engagementContext; /** * Initialize the EngagementContext * * @param Version $version Version that contains the resource * @param string $flowSid Flow SID * @param string $sid The SID of the Engagement resource to fetch */ public function __construct(Version $version, $flowSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['flowSid' => $flowSid, 'sid' => $sid, ]; $this->uri = '/Flows/' . \rawurlencode($flowSid) . '/Engagements/' . \rawurlencode($sid) . ''; } /** * Fetch the EngagementInstance * * @return EngagementInstance Fetched EngagementInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): EngagementInstance { $payload = $this->version->fetch('GET', $this->uri); return new EngagementInstance( $this->version, $payload, $this->solution['flowSid'], $this->solution['sid'] ); } /** * Delete the EngagementInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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) . ']'; } } Studio/V1/Flow/EngagementList.php 0000644 00000013333 15107452342 0012635 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class EngagementList extends ListResource { /** * Construct the EngagementList * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow */ public function __construct(Version $version, string $flowSid) { parent::__construct($version); // Path Solution $this->solution = ['flowSid' => $flowSid, ]; $this->uri = '/Flows/' . \rawurlencode($flowSid) . '/Engagements'; } /** * Streams EngagementInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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); } /** * Create the EngagementInstance * * @param string $to The Contact phone number to start a Studio Flow Engagement * @param string $from The Twilio phone number to send messages or initiate * calls from during the Flow Engagement * @param array|Options $options Optional Arguments * @return EngagementInstance 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']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new EngagementInstance($this->version, $payload, $this->solution['flowSid']); } /** * Constructs a EngagementContext * * @param string $sid The SID of the Engagement resource to fetch */ 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]'; } } Studio/V1/Flow/EngagementInstance.php 0000644 00000011105 15107452342 0013461 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Rest\Studio\V1\Flow\Engagement\EngagementContextList; use Twilio\Rest\Studio\V1\Flow\Engagement\StepList; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $flowSid * @property string $contactSid * @property string $contactChannelAddress * @property array $context * @property string $status * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class EngagementInstance extends InstanceResource { protected $_steps; protected $_engagementContext; /** * Initialize the EngagementInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $flowSid The SID of the Flow * @param string $sid The SID of the Engagement resource to fetch */ public function __construct(Version $version, array $payload, string $flowSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the EngagementInstance * * @return EngagementInstance Fetched EngagementInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): EngagementInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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) . ']'; } } Studio/V1/Flow/ExecutionOptions.php 0000644 00000010533 15107452342 0013245 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow; use Twilio\Options; use Twilio\Values; abstract class ExecutionOptions { /** * @param \DateTime $dateCreatedFrom Only show Executions that started on or * after this ISO 8601 date-time * @param \DateTime $dateCreatedTo Only show Executions that started before * this ISO 8601 date-time * @return ReadExecutionOptions Options builder */ public static function read(\DateTime $dateCreatedFrom = Values::NONE, \DateTime $dateCreatedTo = Values::NONE): ReadExecutionOptions { return new ReadExecutionOptions($dateCreatedFrom, $dateCreatedTo); } /** * @param array $parameters JSON data that will be added to the Flow's context * @return CreateExecutionOptions Options builder */ public static function create(array $parameters = Values::ARRAY_NONE): CreateExecutionOptions { return new CreateExecutionOptions($parameters); } } class ReadExecutionOptions extends Options { /** * @param \DateTime $dateCreatedFrom Only show Executions that started on or * after this ISO 8601 date-time * @param \DateTime $dateCreatedTo Only show Executions that started before * this ISO 8601 date-time */ public function __construct(\DateTime $dateCreatedFrom = Values::NONE, \DateTime $dateCreatedTo = Values::NONE) { $this->options['dateCreatedFrom'] = $dateCreatedFrom; $this->options['dateCreatedTo'] = $dateCreatedTo; } /** * Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. * * @param \DateTime $dateCreatedFrom Only show Executions that started on or * after this ISO 8601 date-time * @return $this Fluent Builder */ public function setDateCreatedFrom(\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 Executions that started before * this ISO 8601 date-time * @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 . ']'; } } class CreateExecutionOptions extends Options { /** * @param array $parameters JSON data that will be added to the Flow's context */ public function __construct(array $parameters = Values::ARRAY_NONE) { $this->options['parameters'] = $parameters; } /** * JSON data that will be added to the Flow's context and that can be accessed as variables inside your Flow. For example, if you pass in `Parameters={"name":"Zeke"}`, a widget in your Flow can reference the variable `{{flow.data.name}}`, which returns "Zeke". Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode the JSON string. * * @param array $parameters JSON data that will be added to the Flow's context * @return $this Fluent Builder */ public function setParameters(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 . ']'; } } Studio/V1/Flow/ExecutionPage.php 0000644 00000002253 15107452342 0012466 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ExecutionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Studio/V1/Flow/EngagementPage.php 0000644 00000002261 15107452342 0012574 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class EngagementPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Studio/V1/Flow/ExecutionContext.php 0000644 00000011573 15107452342 0013243 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Studio\V1\Flow\Execution\ExecutionContextList; use Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStepList; use Twilio\Values; use Twilio\Version; /** * @property ExecutionStepList $steps * @property ExecutionContextList $executionContext * @method \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStepContext steps(string $sid) * @method \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionContextContext executionContext() */ class ExecutionContext extends InstanceContext { protected $_steps; protected $_executionContext; /** * Initialize the ExecutionContext * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow * @param string $sid The SID of the Execution resource to fetch */ public function __construct(Version $version, $flowSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['flowSid' => $flowSid, 'sid' => $sid, ]; $this->uri = '/Flows/' . \rawurlencode($flowSid) . '/Executions/' . \rawurlencode($sid) . ''; } /** * Fetch the ExecutionInstance * * @return ExecutionInstance Fetched ExecutionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ExecutionInstance { $payload = $this->version->fetch('GET', $this->uri); return new ExecutionInstance( $this->version, $payload, $this->solution['flowSid'], $this->solution['sid'] ); } /** * Delete the ExecutionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the ExecutionInstance * * @param string $status The status of the Execution * @return ExecutionInstance Updated ExecutionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status): ExecutionInstance { $data = Values::of(['Status' => $status, ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } Studio/V1/Flow/EngagementOptions.php 0000644 00000004307 15107452342 0013356 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow; use Twilio\Options; use Twilio\Values; abstract class EngagementOptions { /** * @param array $parameters A JSON string we will add to your flow's context * and that you can access as variables inside your * flow * @return CreateEngagementOptions Options builder */ public static function create(array $parameters = Values::ARRAY_NONE): CreateEngagementOptions { return new CreateEngagementOptions($parameters); } } class CreateEngagementOptions extends Options { /** * @param array $parameters A JSON string we will add to your flow's context * and that you can access as variables inside your * flow */ public function __construct(array $parameters = Values::ARRAY_NONE) { $this->options['parameters'] = $parameters; } /** * A JSON string we will add to your flow's context and that you can access as variables inside your flow. For example, if you pass in `Parameters={'name':'Zeke'}` then inside a widget you can reference the variable `{{flow.data.name}}` which will return the string 'Zeke'. Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode your JSON string. * * @param array $parameters A JSON string we will add to your flow's context * and that you can access as variables inside your * flow * @return $this Fluent Builder */ public function setParameters(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 . ']'; } } Studio/V1/Flow/ExecutionInstance.php 0000644 00000011642 15107452342 0013360 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Rest\Studio\V1\Flow\Execution\ExecutionContextList; use Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStepList; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $flowSid * @property string $contactSid * @property string $contactChannelAddress * @property array $context * @property string $status * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class ExecutionInstance extends InstanceResource { protected $_steps; protected $_executionContext; /** * Initialize the ExecutionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $flowSid The SID of the Flow * @param string $sid The SID of the Execution resource to fetch */ public function __construct(Version $version, array $payload, string $flowSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the ExecutionInstance * * @return ExecutionInstance Fetched ExecutionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ExecutionInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Update the ExecutionInstance * * @param string $status The status of the Execution * @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) . ']'; } } Studio/V1/Flow/Execution/ExecutionContextPage.php 0000644 00000002504 15107452342 0015775 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Execution; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ExecutionContextPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Studio/V1/Flow/Execution/ExecutionContextInstance.php 0000644 00000006357 15107452342 0016677 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Execution; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property array $context * @property string $flowSid * @property string $executionSid * @property string $url */ class ExecutionContextInstance extends InstanceResource { /** * Initialize the ExecutionContextInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $flowSid The SID of the Flow * @param string $executionSid The SID of the Execution */ public function __construct(Version $version, array $payload, string $flowSid, string $executionSid) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Studio/V1/Flow/Execution/ExecutionContextContext.php 0000644 00000003444 15107452342 0016551 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Execution; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class ExecutionContextContext extends InstanceContext { /** * Initialize the ExecutionContextContext * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow * @param string $executionSid The SID of the Execution */ public function __construct(Version $version, $flowSid, $executionSid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Studio/V1/Flow/Execution/ExecutionStepInstance.php 0000644 00000010715 15107452342 0016157 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Execution; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStep\ExecutionStepContextList; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $flowSid * @property string $executionSid * @property string $name * @property array $context * @property string $transitionedFrom * @property string $transitionedTo * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class ExecutionStepInstance extends InstanceResource { protected $_stepContext; /** * Initialize the ExecutionStepInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $flowSid The SID of the Flow * @param string $executionSid The SID of the Execution * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $flowSid, string $executionSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Studio/V1/Flow/Execution/ExecutionStepPage.php 0000644 00000002462 15107452342 0015267 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Execution; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ExecutionStepPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Studio/V1/Flow/Execution/ExecutionContextList.php 0000644 00000002370 15107452342 0016035 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Execution; use Twilio\ListResource; use Twilio\Version; class ExecutionContextList extends ListResource { /** * Construct the ExecutionContextList * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow * @param string $executionSid The SID of the Execution */ public function __construct(Version $version, string $flowSid, string $executionSid) { parent::__construct($version); // Path Solution $this->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]'; } } Studio/V1/Flow/Execution/ExecutionStepList.php 0000644 00000012024 15107452342 0015321 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Execution; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ExecutionStepList extends ListResource { /** * Construct the ExecutionStepList * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow * @param string $executionSid The SID of the Execution */ public function __construct(Version $version, string $flowSid, string $executionSid) { parent::__construct($version); // Path Solution $this->solution = ['flowSid' => $flowSid, 'executionSid' => $executionSid, ]; $this->uri = '/Flows/' . \rawurlencode($flowSid) . '/Executions/' . \rawurlencode($executionSid) . '/Steps'; } /** * Streams ExecutionStepInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 unique string that identifies the resource */ 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]'; } } Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextContext.php 0000644 00000003750 15107452342 0022204 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStep; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class ExecutionStepContextContext extends InstanceContext { /** * Initialize the ExecutionStepContextContext * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow * @param string $executionSid The SID of the Execution * @param string $stepSid Step SID */ public function __construct(Version $version, $flowSid, $executionSid, $stepSid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextInstance.php 0000644 00000007056 15107452342 0022327 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStep; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property array $context * @property string $executionSid * @property string $flowSid * @property string $stepSid * @property string $url */ class ExecutionStepContextInstance extends InstanceResource { /** * Initialize the ExecutionStepContextInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $flowSid The SID of the Flow * @param string $executionSid The SID of the Execution * @param string $stepSid Step SID */ public function __construct(Version $version, array $payload, string $flowSid, string $executionSid, string $stepSid) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextList.php 0000644 00000002625 15107452342 0021473 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStep; use Twilio\ListResource; use Twilio\Version; class ExecutionStepContextList extends ListResource { /** * Construct the ExecutionStepContextList * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow * @param string $executionSid The SID of the Execution * @param string $stepSid Step SID */ public function __construct(Version $version, string $flowSid, string $executionSid, string $stepSid) { parent::__construct($version); // Path Solution $this->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]'; } } Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextPage.php 0000644 00000002640 15107452342 0021431 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStep; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ExecutionStepContextPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Studio/V1/Flow/Execution/ExecutionStepContext.php 0000644 00000007370 15107452342 0016042 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Execution; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStep\ExecutionStepContextList; use Twilio\Values; use Twilio\Version; /** * @property ExecutionStepContextList $stepContext * @method \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStep\ExecutionStepContextContext stepContext() */ class ExecutionStepContext extends InstanceContext { protected $_stepContext; /** * Initialize the ExecutionStepContext * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow * @param string $executionSid The SID of the Execution * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $flowSid, $executionSid, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Studio/V1/Flow/ExecutionList.php 0000644 00000014332 15107452342 0012526 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ExecutionList extends ListResource { /** * Construct the ExecutionList * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow */ public function __construct(Version $version, string $flowSid) { parent::__construct($version); // Path Solution $this->solution = ['flowSid' => $flowSid, ]; $this->uri = '/Flows/' . \rawurlencode($flowSid) . '/Executions'; } /** * Streams ExecutionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of ExecutionInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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); } /** * Create the ExecutionInstance * * @param string $to The Contact phone number to start a Studio Flow Execution * @param string $from The Twilio phone number or Messaging Service SID to send * messages or initiate calls from during the Flow Execution * @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']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ExecutionInstance($this->version, $payload, $this->solution['flowSid']); } /** * Constructs a ExecutionContext * * @param string $sid The SID of the Execution resource to fetch */ 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]'; } } Studio/V1.php 0000644 00000004174 15107452342 0007023 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Studio\V1\FlowList; use Twilio\Version; /** * @property FlowList $flows * @method \Twilio\Rest\Studio\V1\FlowContext flows(string $sid) */ class V1 extends Version { protected $_flows; /** * Construct the V1 version of Studio * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->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]'; } } Studio/V2/FlowValidateInstance.php 0000644 00000003077 15107452342 0013073 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property bool $valid */ class FlowValidateInstance extends InstanceResource { /** * Initialize the FlowValidateInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Studio/V2/FlowPage.php 0000644 00000002147 15107452342 0010526 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V2; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class FlowPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Studio/V2/FlowInstance.php 0000644 00000012452 15107452342 0011416 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V2; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Studio\V2\Flow\ExecutionList; use Twilio\Rest\Studio\V2\Flow\FlowRevisionList; use Twilio\Rest\Studio\V2\Flow\FlowTestUserList; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $friendlyName * @property array $definition * @property string $status * @property int $revision * @property string $commitMessage * @property bool $valid * @property array[] $errors * @property array[] $warnings * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $webhookUrl * @property string $url * @property array $links */ class FlowInstance extends InstanceResource { protected $_revisions; protected $_testUsers; protected $_executions; /** * Initialize the FlowInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Update the FlowInstance * * @param string $status The status of the Flow * @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); } /** * Fetch the FlowInstance * * @return FlowInstance Fetched FlowInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FlowInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Access the revisions */ protected function getRevisions(): FlowRevisionList { return $this->proxy()->revisions; } /** * Access the testUsers */ protected function getTestUsers(): FlowTestUserList { return $this->proxy()->testUsers; } /** * 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.V2.FlowInstance ' . \implode(' ', $context) . ']'; } } Studio/V2/FlowValidatePage.php 0000644 00000002227 15107452342 0012177 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V2; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class FlowValidatePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Studio/V2/FlowContext.php 0000644 00000012111 15107452342 0011266 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Studio\V2\Flow\ExecutionList; use Twilio\Rest\Studio\V2\Flow\FlowRevisionList; use Twilio\Rest\Studio\V2\Flow\FlowTestUserList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property FlowRevisionList $revisions * @property FlowTestUserList $testUsers * @property ExecutionList $executions * @method \Twilio\Rest\Studio\V2\Flow\FlowRevisionContext revisions(string $revision) * @method \Twilio\Rest\Studio\V2\Flow\FlowTestUserContext testUsers() * @method \Twilio\Rest\Studio\V2\Flow\ExecutionContext executions(string $sid) */ class FlowContext extends InstanceContext { protected $_revisions; protected $_testUsers; protected $_executions; /** * Initialize the FlowContext * * @param Version $version Version that contains the resource * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Flows/' . \rawurlencode($sid) . ''; } /** * Update the FlowInstance * * @param string $status The status of the Flow * @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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new FlowInstance($this->version, $payload, $this->solution['sid']); } /** * Fetch the FlowInstance * * @return FlowInstance Fetched FlowInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FlowInstance { $payload = $this->version->fetch('GET', $this->uri); return new FlowInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the FlowInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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; } /** * 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.V2.FlowContext ' . \implode(' ', $context) . ']'; } } Studio/V2/FlowList.php 0000644 00000012733 15107452342 0010567 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V2; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class FlowList extends ListResource { /** * Construct the FlowList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Flows'; } /** * Create the FlowInstance * * @param string $friendlyName The string that you assigned to describe the Flow * @param string $status The status of the Flow * @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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new FlowInstance($this->version, $payload); } /** * 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']); } /** * 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); } /** * 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 that identifies the resource to fetch */ 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]'; } } Studio/V2/Flow/FlowRevisionInstance.php 0000644 00000010036 15107452342 0014040 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V2\Flow; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $friendlyName * @property array $definition * @property string $status * @property int $revision * @property string $commitMessage * @property bool $valid * @property array[] $errors * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class FlowRevisionInstance extends InstanceResource { /** * Initialize the FlowRevisionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the resource * @param string $revision Specific Revision number or can be `LatestPublished` * and `LatestRevision` */ public function __construct(Version $version, array $payload, string $sid, string $revision = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Studio/V2/Flow/FlowTestUserList.php 0000644 00000002013 15107452343 0013164 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V2\Flow; use Twilio\ListResource; use Twilio\Version; class FlowTestUserList extends ListResource { /** * Construct the FlowTestUserList * * @param Version $version Version that contains the resource * @param string $sid Unique identifier of the flow. */ public function __construct(Version $version, string $sid) { parent::__construct($version); // Path Solution $this->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]'; } } Studio/V2/Flow/FlowRevisionList.php 0000644 00000011511 15107452343 0013207 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V2\Flow; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class FlowRevisionList extends ListResource { /** * Construct the FlowRevisionList * * @param Version $version Version that contains the resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, string $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Flows/' . \rawurlencode($sid) . '/Revisions'; } /** * 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']); } /** * 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); } /** * 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]'; } } Studio/V2/Flow/ExecutionOptions.php 0000644 00000010533 15107452343 0013247 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V2\Flow; use Twilio\Options; use Twilio\Values; abstract class ExecutionOptions { /** * @param \DateTime $dateCreatedFrom Only show Executions that started on or * after this ISO 8601 date-time * @param \DateTime $dateCreatedTo Only show Executions that started before * this ISO 8601 date-time * @return ReadExecutionOptions Options builder */ public static function read(\DateTime $dateCreatedFrom = Values::NONE, \DateTime $dateCreatedTo = Values::NONE): ReadExecutionOptions { return new ReadExecutionOptions($dateCreatedFrom, $dateCreatedTo); } /** * @param array $parameters JSON data that will be added to the Flow's context * @return CreateExecutionOptions Options builder */ public static function create(array $parameters = Values::ARRAY_NONE): CreateExecutionOptions { return new CreateExecutionOptions($parameters); } } class ReadExecutionOptions extends Options { /** * @param \DateTime $dateCreatedFrom Only show Executions that started on or * after this ISO 8601 date-time * @param \DateTime $dateCreatedTo Only show Executions that started before * this ISO 8601 date-time */ public function __construct(\DateTime $dateCreatedFrom = Values::NONE, \DateTime $dateCreatedTo = Values::NONE) { $this->options['dateCreatedFrom'] = $dateCreatedFrom; $this->options['dateCreatedTo'] = $dateCreatedTo; } /** * Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. * * @param \DateTime $dateCreatedFrom Only show Executions that started on or * after this ISO 8601 date-time * @return $this Fluent Builder */ public function setDateCreatedFrom(\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 Executions that started before * this ISO 8601 date-time * @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 . ']'; } } class CreateExecutionOptions extends Options { /** * @param array $parameters JSON data that will be added to the Flow's context */ public function __construct(array $parameters = Values::ARRAY_NONE) { $this->options['parameters'] = $parameters; } /** * JSON data that will be added to the Flow's context and that can be accessed as variables inside your Flow. For example, if you pass in `Parameters={"name":"Zeke"}`, a widget in your Flow can reference the variable `{{flow.data.name}}`, which returns "Zeke". Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode the JSON string. * * @param array $parameters JSON data that will be added to the Flow's context * @return $this Fluent Builder */ public function setParameters(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 . ']'; } } Studio/V2/Flow/ExecutionPage.php 0000644 00000002253 15107452343 0012470 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V2\Flow; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ExecutionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Studio/V2/Flow/ExecutionContext.php 0000644 00000011573 15107452343 0013245 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V2\Flow; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Studio\V2\Flow\Execution\ExecutionContextList; use Twilio\Rest\Studio\V2\Flow\Execution\ExecutionStepList; use Twilio\Values; use Twilio\Version; /** * @property ExecutionStepList $steps * @property ExecutionContextList $executionContext * @method \Twilio\Rest\Studio\V2\Flow\Execution\ExecutionStepContext steps(string $sid) * @method \Twilio\Rest\Studio\V2\Flow\Execution\ExecutionContextContext executionContext() */ class ExecutionContext extends InstanceContext { protected $_steps; protected $_executionContext; /** * Initialize the ExecutionContext * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow * @param string $sid The SID of the Execution resource to fetch */ public function __construct(Version $version, $flowSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['flowSid' => $flowSid, 'sid' => $sid, ]; $this->uri = '/Flows/' . \rawurlencode($flowSid) . '/Executions/' . \rawurlencode($sid) . ''; } /** * Fetch the ExecutionInstance * * @return ExecutionInstance Fetched ExecutionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ExecutionInstance { $payload = $this->version->fetch('GET', $this->uri); return new ExecutionInstance( $this->version, $payload, $this->solution['flowSid'], $this->solution['sid'] ); } /** * Delete the ExecutionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the ExecutionInstance * * @param string $status The status of the Execution * @return ExecutionInstance Updated ExecutionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status): ExecutionInstance { $data = Values::of(['Status' => $status, ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } Studio/V2/Flow/FlowTestUserContext.php 0000644 00000004255 15107452343 0013707 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V2\Flow; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class FlowTestUserContext extends InstanceContext { /** * Initialize the FlowTestUserContext * * @param Version $version Version that contains the resource * @param string $sid Unique identifier of the flow. */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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; }), ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } Studio/V2/Flow/FlowRevisionPage.php 0000644 00000002271 15107452343 0013153 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V2\Flow; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class FlowRevisionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Studio/V2/Flow/FlowTestUserPage.php 0000644 00000002271 15107452343 0013133 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V2\Flow; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class FlowTestUserPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Studio/V2/Flow/ExecutionInstance.php 0000644 00000011472 15107452343 0013363 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V2\Flow; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Rest\Studio\V2\Flow\Execution\ExecutionContextList; use Twilio\Rest\Studio\V2\Flow\Execution\ExecutionStepList; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $flowSid * @property string $contactChannelAddress * @property array $context * @property string $status * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class ExecutionInstance extends InstanceResource { protected $_steps; protected $_executionContext; /** * Initialize the ExecutionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $flowSid The SID of the Flow * @param string $sid The SID of the Execution resource to fetch */ public function __construct(Version $version, array $payload, string $flowSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the ExecutionInstance * * @return ExecutionInstance Fetched ExecutionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ExecutionInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Update the ExecutionInstance * * @param string $status The status of the Execution * @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) . ']'; } } Studio/V2/Flow/FlowTestUserInstance.php 0000644 00000006310 15107452343 0014021 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V2\Flow; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string[] $testUsers * @property string $url */ class FlowTestUserInstance extends InstanceResource { /** * Initialize the FlowTestUserInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid Unique identifier of the flow. */ public function __construct(Version $version, array $payload, string $sid) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Studio/V2/Flow/Execution/ExecutionContextPage.php 0000644 00000002504 15107452343 0015777 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V2\Flow\Execution; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ExecutionContextPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Studio/V2/Flow/Execution/ExecutionContextInstance.php 0000644 00000006357 15107452343 0016701 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V2\Flow\Execution; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property array $context * @property string $flowSid * @property string $executionSid * @property string $url */ class ExecutionContextInstance extends InstanceResource { /** * Initialize the ExecutionContextInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $flowSid The SID of the Flow * @param string $executionSid The SID of the Execution */ public function __construct(Version $version, array $payload, string $flowSid, string $executionSid) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Studio/V2/Flow/Execution/ExecutionContextContext.php 0000644 00000003444 15107452343 0016553 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V2\Flow\Execution; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class ExecutionContextContext extends InstanceContext { /** * Initialize the ExecutionContextContext * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow * @param string $executionSid The SID of the Execution */ public function __construct(Version $version, $flowSid, $executionSid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Studio/V2/Flow/Execution/ExecutionStepInstance.php 0000644 00000010715 15107452343 0016161 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V2\Flow\Execution; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Rest\Studio\V2\Flow\Execution\ExecutionStep\ExecutionStepContextList; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $flowSid * @property string $executionSid * @property string $name * @property array $context * @property string $transitionedFrom * @property string $transitionedTo * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class ExecutionStepInstance extends InstanceResource { protected $_stepContext; /** * Initialize the ExecutionStepInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $flowSid The SID of the Flow * @param string $executionSid The SID of the Execution * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $flowSid, string $executionSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Studio/V2/Flow/Execution/ExecutionStepPage.php 0000644 00000002462 15107452343 0015271 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V2\Flow\Execution; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ExecutionStepPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Studio/V2/Flow/Execution/ExecutionContextList.php 0000644 00000002370 15107452343 0016037 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V2\Flow\Execution; use Twilio\ListResource; use Twilio\Version; class ExecutionContextList extends ListResource { /** * Construct the ExecutionContextList * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow * @param string $executionSid The SID of the Execution */ public function __construct(Version $version, string $flowSid, string $executionSid) { parent::__construct($version); // Path Solution $this->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]'; } } Studio/V2/Flow/Execution/ExecutionStepList.php 0000644 00000012024 15107452343 0015323 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V2\Flow\Execution; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ExecutionStepList extends ListResource { /** * Construct the ExecutionStepList * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow * @param string $executionSid The SID of the Execution */ public function __construct(Version $version, string $flowSid, string $executionSid) { parent::__construct($version); // Path Solution $this->solution = ['flowSid' => $flowSid, 'executionSid' => $executionSid, ]; $this->uri = '/Flows/' . \rawurlencode($flowSid) . '/Executions/' . \rawurlencode($executionSid) . '/Steps'; } /** * Streams ExecutionStepInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 unique string that identifies the resource */ 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]'; } } Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextContext.php 0000644 00000003750 15107452343 0022206 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V2\Flow\Execution\ExecutionStep; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class ExecutionStepContextContext extends InstanceContext { /** * Initialize the ExecutionStepContextContext * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow * @param string $executionSid The SID of the Execution * @param string $stepSid Step SID */ public function __construct(Version $version, $flowSid, $executionSid, $stepSid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextInstance.php 0000644 00000007056 15107452344 0022332 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V2\Flow\Execution\ExecutionStep; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property array $context * @property string $executionSid * @property string $flowSid * @property string $stepSid * @property string $url */ class ExecutionStepContextInstance extends InstanceResource { /** * Initialize the ExecutionStepContextInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $flowSid The SID of the Flow * @param string $executionSid The SID of the Execution * @param string $stepSid Step SID */ public function __construct(Version $version, array $payload, string $flowSid, string $executionSid, string $stepSid) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextList.php 0000644 00000002625 15107452344 0021476 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V2\Flow\Execution\ExecutionStep; use Twilio\ListResource; use Twilio\Version; class ExecutionStepContextList extends ListResource { /** * Construct the ExecutionStepContextList * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow * @param string $executionSid The SID of the Execution * @param string $stepSid Step SID */ public function __construct(Version $version, string $flowSid, string $executionSid, string $stepSid) { parent::__construct($version); // Path Solution $this->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]'; } } Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextPage.php 0000644 00000002640 15107452344 0021434 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V2\Flow\Execution\ExecutionStep; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ExecutionStepContextPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Studio/V2/Flow/Execution/ExecutionStepContext.php 0000644 00000007370 15107452344 0016045 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V2\Flow\Execution; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Studio\V2\Flow\Execution\ExecutionStep\ExecutionStepContextList; use Twilio\Values; use Twilio\Version; /** * @property ExecutionStepContextList $stepContext * @method \Twilio\Rest\Studio\V2\Flow\Execution\ExecutionStep\ExecutionStepContextContext stepContext() */ class ExecutionStepContext extends InstanceContext { protected $_stepContext; /** * Initialize the ExecutionStepContext * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow * @param string $executionSid The SID of the Execution * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $flowSid, $executionSid, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Studio/V2/Flow/ExecutionList.php 0000644 00000014332 15107452344 0012531 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V2\Flow; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ExecutionList extends ListResource { /** * Construct the ExecutionList * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow */ public function __construct(Version $version, string $flowSid) { parent::__construct($version); // Path Solution $this->solution = ['flowSid' => $flowSid, ]; $this->uri = '/Flows/' . \rawurlencode($flowSid) . '/Executions'; } /** * Streams ExecutionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of ExecutionInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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); } /** * Create the ExecutionInstance * * @param string $to The Contact phone number to start a Studio Flow Execution * @param string $from The Twilio phone number or Messaging Service SID to send * messages or initiate calls from during the Flow Execution * @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']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ExecutionInstance($this->version, $payload, $this->solution['flowSid']); } /** * Constructs a ExecutionContext * * @param string $sid The SID of the Execution resource to fetch */ 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]'; } } Studio/V2/Flow/FlowRevisionContext.php 0000644 00000003453 15107452344 0013727 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V2\Flow; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class FlowRevisionContext extends InstanceContext { /** * Initialize the FlowRevisionContext * * @param Version $version Version that contains the resource * @param string $sid The SID that identifies the resource to fetch * @param string $revision Specific Revision number or can be `LatestPublished` * and `LatestRevision` */ public function __construct(Version $version, $sid, $revision) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Studio/V2/FlowValidateOptions.php 0000644 00000002735 15107452344 0012764 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V2; use Twilio\Options; use Twilio\Values; abstract class FlowValidateOptions { /** * @param string $commitMessage Description of change made in the revision * @return UpdateFlowValidateOptions Options builder */ public static function update(string $commitMessage = Values::NONE): UpdateFlowValidateOptions { return new UpdateFlowValidateOptions($commitMessage); } } class UpdateFlowValidateOptions extends Options { /** * @param string $commitMessage Description of change made in the revision */ public function __construct(string $commitMessage = Values::NONE) { $this->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 . ']'; } } Studio/V2/FlowOptions.php 0000644 00000007570 15107452344 0011314 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V2; use Twilio\Options; use Twilio\Values; abstract class FlowOptions { /** * @param string $commitMessage Description of change made in the revision * @return CreateFlowOptions Options builder */ public static function create(string $commitMessage = Values::NONE): CreateFlowOptions { return new CreateFlowOptions($commitMessage); } /** * @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 * @return UpdateFlowOptions Options builder */ public static function update(string $friendlyName = Values::NONE, array $definition = Values::ARRAY_NONE, string $commitMessage = Values::NONE): UpdateFlowOptions { return new UpdateFlowOptions($friendlyName, $definition, $commitMessage); } } class CreateFlowOptions extends Options { /** * @param string $commitMessage Description of change made in the revision */ public function __construct(string $commitMessage = Values::NONE) { $this->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 . ']'; } } Studio/V2/FlowValidateList.php 0000644 00000003552 15107452344 0012242 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V2; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class FlowValidateList extends ListResource { /** * Construct the FlowValidateList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Flows/Validate'; } /** * Update the FlowValidateInstance * * @param string $friendlyName The string that you assigned to describe the Flow * @param string $status The status of the Flow * @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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new FlowValidateInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V2.FlowValidateList]'; } } Studio/V2.php 0000644 00000004712 15107452344 0007024 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Studio\V2\FlowList; use Twilio\Rest\Studio\V2\FlowValidateList; use Twilio\Version; /** * @property FlowList $flows * @property FlowValidateList $flowValidate * @method \Twilio\Rest\Studio\V2\FlowContext flows(string $sid) */ class V2 extends Version { protected $_flows; protected $_flowValidate; /** * Construct the V2 version of Studio * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->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]'; } } Serverless/V1/Service/EnvironmentList.php 0000644 00000013446 15107452344 0014455 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class EnvironmentList extends ListResource { /** * Construct the EnvironmentList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the Environment * resource is associated with */ public function __construct(Version $version, string $serviceSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Environments'; } /** * Streams EnvironmentInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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); } /** * Create the EnvironmentInstance * * @param string $uniqueName A user-defined string that uniquely identifies the * Environment resource * @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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new EnvironmentInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Constructs a EnvironmentContext * * @param string $sid The SID of the Environment resource to fetch */ 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]'; } } Serverless/V1/Service/BuildList.php 0000644 00000013366 15107452344 0013211 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class BuildList extends ListResource { /** * Construct the BuildList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the Build resource is * associated with */ public function __construct(Version $version, string $serviceSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Builds'; } /** * Streams BuildInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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); } /** * 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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new BuildInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Constructs a BuildContext * * @param string $sid The SID of the Build resource to fetch */ 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]'; } } Serverless/V1/Service/Environment/LogList.php 0000644 00000013321 15107452344 0015166 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class LogList extends ListResource { /** * Construct the LogList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the Log resource is * associated with * @param string $environmentSid The SID of the environment in which the log * occurred */ public function __construct(Version $version, string $serviceSid, string $environmentSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'environmentSid' => $environmentSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Environments/' . \rawurlencode($environmentSid) . '/Logs'; } /** * Streams LogInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of LogInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 that identifies 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]'; } } Serverless/V1/Service/Environment/DeploymentContext.php 0000644 00000004322 15107452344 0017277 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class DeploymentContext extends InstanceContext { /** * Initialize the DeploymentContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the Deployment * resource from * @param string $environmentSid The SID of the Environment used by the * Deployment to fetch * @param string $sid The SID that identifies the Deployment resource to fetch */ public function __construct(Version $version, $serviceSid, $environmentSid, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Serverless/V1/Service/Environment/DeploymentOptions.php 0000644 00000003026 15107452344 0017306 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ abstract class DeploymentOptions { /** * @param string $buildSid The SID of the Build for the Deployment * @return CreateDeploymentOptions Options builder */ public static function create(string $buildSid = Values::NONE): CreateDeploymentOptions { return new CreateDeploymentOptions($buildSid); } } class CreateDeploymentOptions extends Options { /** * @param string $buildSid The SID of the Build for the Deployment */ public function __construct(string $buildSid = Values::NONE) { $this->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 . ']'; } } Serverless/V1/Service/Environment/VariablePage.php 0000644 00000002640 15107452344 0016135 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class VariablePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Serverless/V1/Service/Environment/DeploymentInstance.php 0000644 00000010027 15107452344 0017416 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $environmentSid * @property string $buildSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class DeploymentInstance extends InstanceResource { /** * Initialize the DeploymentInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the Deployment * resource is associated with * @param string $environmentSid The SID of the Environment for the Deployment * @param string $sid The SID that identifies the Deployment resource to fetch */ public function __construct(Version $version, array $payload, string $serviceSid, string $environmentSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Serverless/V1/Service/Environment/LogContext.php 0000644 00000004204 15107452344 0015677 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class LogContext extends InstanceContext { /** * Initialize the LogContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the Log resource * from * @param string $environmentSid The SID of the environment with the Log * resource to fetch * @param string $sid The SID that identifies the Log resource to fetch */ public function __construct(Version $version, $serviceSid, $environmentSid, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Serverless/V1/Service/Environment/LogInstance.php 0000644 00000010535 15107452344 0016023 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $environmentSid * @property string $buildSid * @property string $deploymentSid * @property string $functionSid * @property string $requestSid * @property string $level * @property string $message * @property \DateTime $dateCreated * @property string $url */ class LogInstance extends InstanceResource { /** * Initialize the LogInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the Log resource is * associated with * @param string $environmentSid The SID of the environment in which the log * occurred * @param string $sid The SID that identifies the Log resource to fetch */ public function __construct(Version $version, array $payload, string $serviceSid, string $environmentSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Serverless/V1/Service/Environment/DeploymentPage.php 0000644 00000002654 15107452344 0016535 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class DeploymentPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Serverless/V1/Service/Environment/DeploymentList.php 0000644 00000013737 15107452344 0016600 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class DeploymentList extends ListResource { /** * Construct the DeploymentList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the Deployment * resource is associated with * @param string $environmentSid The SID of the Environment for the Deployment */ public function __construct(Version $version, string $serviceSid, string $environmentSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'environmentSid' => $environmentSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Environments/' . \rawurlencode($environmentSid) . '/Deployments'; } /** * Streams DeploymentInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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); } /** * 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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new DeploymentInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['environmentSid'] ); } /** * Constructs a DeploymentContext * * @param string $sid The SID that identifies the Deployment resource to fetch */ 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]'; } } Serverless/V1/Service/Environment/LogPage.php 0000644 00000002602 15107452344 0015127 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class LogPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Serverless/V1/Service/Environment/VariableContext.php 0000644 00000006276 15107452344 0016716 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class VariableContext extends InstanceContext { /** * Initialize the VariableContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the Variable * resource from * @param string $environmentSid The SID of the Environment with the Variable * resource to fetch * @param string $sid The SID of the Variable resource to fetch */ public function __construct(Version $version, $serviceSid, $environmentSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'environmentSid' => $environmentSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Environments/' . \rawurlencode($environmentSid) . '/Variables/' . \rawurlencode($sid) . ''; } /** * Fetch the VariableInstance * * @return VariableInstance Fetched VariableInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): VariableInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new VariableInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['environmentSid'], $this->solution['sid'] ); } /** * Delete the VariableInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Serverless/V1/Service/Environment/LogOptions.php 0000644 00000006734 15107452344 0015720 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ abstract class LogOptions { /** * @param string $functionSid The SID of the function whose invocation produced * the Log resources to read * @param \DateTime $startDate The date and time after which the Log resources * must have been created. * @param \DateTime $endDate The date and time before which the Log resource * must have been created. * @return ReadLogOptions Options builder */ public static function read(string $functionSid = Values::NONE, \DateTime $startDate = Values::NONE, \DateTime $endDate = Values::NONE): ReadLogOptions { return new ReadLogOptions($functionSid, $startDate, $endDate); } } class ReadLogOptions extends Options { /** * @param string $functionSid The SID of the function whose invocation produced * the Log resources to read * @param \DateTime $startDate The date and time after which the Log resources * must have been created. * @param \DateTime $endDate The date and time before which the Log resource * must have been created. */ public function __construct(string $functionSid = Values::NONE, \DateTime $startDate = Values::NONE, \DateTime $endDate = Values::NONE) { $this->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 and time after which the Log resources * must have been created. * @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 and time before which the Log resource * must have been created. * @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 . ']'; } } Serverless/V1/Service/Environment/VariableOptions.php 0000644 00000004307 15107452344 0016716 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ abstract class VariableOptions { /** * @param string $key A string by which the Variable resource can be referenced * @param string $value A string that contains the actual value of the Variable * @return UpdateVariableOptions Options builder */ public static function update(string $key = Values::NONE, string $value = Values::NONE): UpdateVariableOptions { return new UpdateVariableOptions($key, $value); } } class UpdateVariableOptions extends Options { /** * @param string $key A string by which the Variable resource can be referenced * @param string $value A string that contains the actual value of the Variable */ public function __construct(string $key = Values::NONE, string $value = Values::NONE) { $this->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 * @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 * @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 . ']'; } } Serverless/V1/Service/Environment/VariableInstance.php 0000644 00000011342 15107452344 0017024 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $environmentSid * @property string $key * @property string $value * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class VariableInstance extends InstanceResource { /** * Initialize the VariableInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the Variable resource * is associated with * @param string $environmentSid The SID of the Environment in which the * Variable exists * @param string $sid The SID of the Variable resource to fetch */ public function __construct(Version $version, array $payload, string $serviceSid, string $environmentSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Serverless/V1/Service/Environment/VariableList.php 0000644 00000014002 15107452344 0016167 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class VariableList extends ListResource { /** * Construct the VariableList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the Variable resource * is associated with * @param string $environmentSid The SID of the Environment in which the * Variable exists */ public function __construct(Version $version, string $serviceSid, string $environmentSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'environmentSid' => $environmentSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Environments/' . \rawurlencode($environmentSid) . '/Variables'; } /** * Streams VariableInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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); } /** * Create the VariableInstance * * @param string $key A string by which the Variable resource can be referenced * @param string $value A string that contains the actual value of the Variable * @return VariableInstance Created VariableInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $key, string $value): VariableInstance { $data = Values::of(['Key' => $key, 'Value' => $value, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new VariableInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['environmentSid'] ); } /** * Constructs a VariableContext * * @param string $sid The SID of the Variable resource to fetch */ 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]'; } } Serverless/V1/Service/EnvironmentInstance.php 0000644 00000011776 15107452344 0015312 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Rest\Serverless\V1\Service\Environment\DeploymentList; use Twilio\Rest\Serverless\V1\Service\Environment\LogList; use Twilio\Rest\Serverless\V1\Service\Environment\VariableList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $buildSid * @property string $uniqueName * @property string $domainSuffix * @property string $domainName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class EnvironmentInstance extends InstanceResource { protected $_variables; protected $_deployments; protected $_logs; /** * Initialize the EnvironmentInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the Environment * resource is associated with * @param string $sid The SID of the Environment resource to fetch */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the EnvironmentInstance * * @return EnvironmentInstance Fetched EnvironmentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): EnvironmentInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Access the variables */ protected function getVariables(): VariableList { return $this->proxy()->variables; } /** * Access the deployments */ protected function getDeployments(): DeploymentList { return $this->proxy()->deployments; } /** * Access the logs */ protected function getLogs(): LogList { return $this->proxy()->logs; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Serverless/V1/Service/EnvironmentPage.php 0000644 00000002475 15107452344 0014416 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class EnvironmentPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Serverless/V1/Service/AssetList.php 0000644 00000012641 15107452344 0013224 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class AssetList extends ListResource { /** * Construct the AssetList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the Asset resource is * associated with */ public function __construct(Version $version, string $serviceSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Assets'; } /** * Streams AssetInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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); } /** * Create the AssetInstance * * @param string $friendlyName A string to describe the Asset resource * @return AssetInstance Created AssetInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName): AssetInstance { $data = Values::of(['FriendlyName' => $friendlyName, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AssetInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Constructs a AssetContext * * @param string $sid The SID that identifies the Asset resource to fetch */ 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]'; } } Serverless/V1/Service/FunctionInstance.php 0000644 00000011202 15107452344 0014553 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Rest\Serverless\V1\Service\TwilioFunction\FunctionVersionList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class FunctionInstance extends InstanceResource { protected $_functionVersions; /** * Initialize the FunctionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the Function resource * is associated with * @param string $sid The SID of the Function resource to fetch */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the FunctionInstance * * @return FunctionInstance Fetched FunctionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FunctionInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Update the FunctionInstance * * @param string $friendlyName A string to describe the Function resource * @return FunctionInstance Updated FunctionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(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) . ']'; } } Serverless/V1/Service/TwilioFunction/FunctionVersionContext.php 0000644 00000010355 15107452344 0020766 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\TwilioFunction; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Serverless\V1\Service\TwilioFunction\FunctionVersion\FunctionVersionContentList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property FunctionVersionContentList $functionVersionContent * @method \Twilio\Rest\Serverless\V1\Service\TwilioFunction\FunctionVersion\FunctionVersionContentContext functionVersionContent() */ class FunctionVersionContext extends InstanceContext { protected $_functionVersionContent; /** * Initialize the FunctionVersionContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the Function * Version resource from * @param string $functionSid The SID of the function that is the parent of the * Function Version resource to fetch * @param string $sid The SID that identifies the Function Version resource to * fetch */ public function __construct(Version $version, $serviceSid, $functionSid, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Serverless/V1/Service/TwilioFunction/FunctionVersionPage.php 0000644 00000002715 15107452344 0020217 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\TwilioFunction; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class FunctionVersionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentContext.php 0000644 00000004557 15107452344 0025463 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\TwilioFunction\FunctionVersion; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class FunctionVersionContentContext extends InstanceContext { /** * Initialize the FunctionVersionContentContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the Function * Version content from * @param string $functionSid The SID of the Function that is the parent of the * Function Version content to fetch * @param string $sid The SID that identifies the Function Version content to * fetch */ public function __construct(Version $version, $serviceSid, $functionSid, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentList.php 0000644 00000003421 15107452344 0024737 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\TwilioFunction\FunctionVersion; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class FunctionVersionContentList extends ListResource { /** * Construct the FunctionVersionContentList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the Function Version * resource is associated with * @param string $functionSid The SID of the Function that is the parent of the * Function Version * @param string $sid The unique string that identifies the Function Version * resource */ public function __construct(Version $version, string $serviceSid, string $functionSid, string $sid) { parent::__construct($version); // Path Solution $this->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]'; } } Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentInstance.php 0000644 00000007653 15107452344 0025603 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\TwilioFunction\FunctionVersion; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $functionSid * @property string $content * @property string $url */ class FunctionVersionContentInstance extends InstanceResource { /** * Initialize the FunctionVersionContentInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the Function Version * resource is associated with * @param string $functionSid The SID of the Function that is the parent of the * Function Version * @param string $sid The unique string that identifies the Function Version * resource */ public function __construct(Version $version, array $payload, string $serviceSid, string $functionSid, string $sid) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentPage.php 0000644 00000003073 15107452344 0024703 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\TwilioFunction\FunctionVersion; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class FunctionVersionContentPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Serverless/V1/Service/TwilioFunction/FunctionVersionList.php 0000644 00000012656 15107452344 0020263 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\TwilioFunction; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class FunctionVersionList extends ListResource { /** * Construct the FunctionVersionList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the Function Version * resource is associated with * @param string $functionSid The SID of the Function resource that is the * parent of the Function Version resource */ public function __construct(Version $version, string $serviceSid, string $functionSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'functionSid' => $functionSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Functions/' . \rawurlencode($functionSid) . '/Versions'; } /** * Streams FunctionVersionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 that identifies 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]'; } } Serverless/V1/Service/TwilioFunction/FunctionVersionInstance.php 0000644 00000011046 15107452344 0021104 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\TwilioFunction; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Rest\Serverless\V1\Service\TwilioFunction\FunctionVersion\FunctionVersionContentList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $functionSid * @property string $path * @property string $visibility * @property \DateTime $dateCreated * @property string $url * @property array $links */ class FunctionVersionInstance extends InstanceResource { protected $_functionVersionContent; /** * Initialize the FunctionVersionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the Function Version * resource is associated with * @param string $functionSid The SID of the Function resource that is the * parent of the Function Version resource * @param string $sid The SID that identifies the Function Version resource to * fetch */ public function __construct(Version $version, array $payload, string $serviceSid, string $functionSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Serverless/V1/Service/FunctionContext.php 0000644 00000011126 15107452344 0014440 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Serverless\V1\Service\TwilioFunction\FunctionVersionList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property FunctionVersionList $functionVersions * @method \Twilio\Rest\Serverless\V1\Service\TwilioFunction\FunctionVersionContext functionVersions(string $sid) */ class FunctionContext extends InstanceContext { protected $_functionVersions; /** * Initialize the FunctionContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the Function * resource from * @param string $sid The SID of the Function resource to fetch */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Functions/' . \rawurlencode($sid) . ''; } /** * Fetch the FunctionInstance * * @return FunctionInstance Fetched FunctionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FunctionInstance { $payload = $this->version->fetch('GET', $this->uri); return new FunctionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Delete the FunctionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the FunctionInstance * * @param string $friendlyName A string to describe the Function resource * @return FunctionInstance Updated FunctionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $friendlyName): FunctionInstance { $data = Values::of(['FriendlyName' => $friendlyName, ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } Serverless/V1/Service/AssetContext.php 0000644 00000010764 15107452344 0013741 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Serverless\V1\Service\Asset\AssetVersionList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property AssetVersionList $assetVersions * @method \Twilio\Rest\Serverless\V1\Service\Asset\AssetVersionContext assetVersions(string $sid) */ class AssetContext extends InstanceContext { protected $_assetVersions; /** * Initialize the AssetContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the Asset resource * from * @param string $sid The SID that identifies the Asset resource to fetch */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Assets/' . \rawurlencode($sid) . ''; } /** * Fetch the AssetInstance * * @return AssetInstance Fetched AssetInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AssetInstance { $payload = $this->version->fetch('GET', $this->uri); return new AssetInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Delete the AssetInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the AssetInstance * * @param string $friendlyName A string to describe the Asset resource * @return AssetInstance Updated AssetInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $friendlyName): AssetInstance { $data = Values::of(['FriendlyName' => $friendlyName, ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } Serverless/V1/Service/EnvironmentContext.php 0000644 00000011720 15107452344 0015157 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Serverless\V1\Service\Environment\DeploymentList; use Twilio\Rest\Serverless\V1\Service\Environment\LogList; use Twilio\Rest\Serverless\V1\Service\Environment\VariableList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property VariableList $variables * @property DeploymentList $deployments * @property LogList $logs * @method \Twilio\Rest\Serverless\V1\Service\Environment\VariableContext variables(string $sid) * @method \Twilio\Rest\Serverless\V1\Service\Environment\DeploymentContext deployments(string $sid) * @method \Twilio\Rest\Serverless\V1\Service\Environment\LogContext logs(string $sid) */ class EnvironmentContext extends InstanceContext { protected $_variables; protected $_deployments; protected $_logs; /** * Initialize the EnvironmentContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the Environment * resource from * @param string $sid The SID of the Environment resource to fetch */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Environments/' . \rawurlencode($sid) . ''; } /** * Fetch the EnvironmentInstance * * @return EnvironmentInstance Fetched EnvironmentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): EnvironmentInstance { $payload = $this->version->fetch('GET', $this->uri); return new EnvironmentInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Delete the EnvironmentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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; } /** * 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 logs */ protected function getLogs(): LogList { if (!$this->_logs) { $this->_logs = new LogList($this->version, $this->solution['serviceSid'], $this->solution['sid']); } return $this->_logs; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return 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) . ']'; } } Serverless/V1/Service/FunctionList.php 0000644 00000012750 15107452344 0013733 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class FunctionList extends ListResource { /** * Construct the FunctionList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the Function resource * is associated with */ public function __construct(Version $version, string $serviceSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Functions'; } /** * Streams FunctionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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); } /** * Create the FunctionInstance * * @param string $friendlyName A string to describe the Function resource * @return FunctionInstance Created FunctionInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName): FunctionInstance { $data = Values::of(['FriendlyName' => $friendlyName, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new FunctionInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Constructs a FunctionContext * * @param string $sid The SID of the Function resource to fetch */ 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]'; } } Serverless/V1/Service/AssetInstance.php 0000644 00000011073 15107452344 0014053 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Rest\Serverless\V1\Service\Asset\AssetVersionList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class AssetInstance extends InstanceResource { protected $_assetVersions; /** * Initialize the AssetInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the Asset resource is * associated with * @param string $sid The SID that identifies the Asset resource to fetch */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the AssetInstance * * @return AssetInstance Fetched AssetInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AssetInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Update the AssetInstance * * @param string $friendlyName A string to describe the Asset resource * @return AssetInstance Updated AssetInstance * @throws TwilioException When an HTTP error occurs. */ public function update(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) . ']'; } } Serverless/V1/Service/Asset/AssetVersionInstance.php 0000644 00000010043 15107452344 0016474 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Asset; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $assetSid * @property string $path * @property string $visibility * @property \DateTime $dateCreated * @property string $url */ class AssetVersionInstance extends InstanceResource { /** * Initialize the AssetVersionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the Asset Version * resource is associated with * @param string $assetSid The SID of the Asset resource that is the parent of * the Asset Version * @param string $sid The SID that identifies the Asset Version resource to * fetch */ public function __construct(Version $version, array $payload, string $serviceSid, string $assetSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Serverless/V1/Service/Asset/AssetVersionList.php 0000644 00000012477 15107452344 0015660 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Asset; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class AssetVersionList extends ListResource { /** * Construct the AssetVersionList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the Asset Version * resource is associated with * @param string $assetSid The SID of the Asset resource that is the parent of * the Asset Version */ public function __construct(Version $version, string $serviceSid, string $assetSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'assetSid' => $assetSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Assets/' . \rawurlencode($assetSid) . '/Versions'; } /** * Streams AssetVersionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 that identifies 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]'; } } Serverless/V1/Service/Asset/AssetVersionPage.php 0000644 00000002646 15107452344 0015616 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Asset; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class AssetVersionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Serverless/V1/Service/Asset/AssetVersionContext.php 0000644 00000004346 15107452344 0016365 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Asset; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class AssetVersionContext extends InstanceContext { /** * Initialize the AssetVersionContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the Asset Version * resource from * @param string $assetSid The SID of the Asset resource that is the parent of * the Asset Version resource to fetch * @param string $sid The SID that identifies the Asset Version resource to * fetch */ public function __construct(Version $version, $serviceSid, $assetSid, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Serverless/V1/Service/BuildInstance.php 0000644 00000011134 15107452344 0014031 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Rest\Serverless\V1\Service\Build\BuildStatusList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $status * @property array[] $assetVersions * @property array[] $functionVersions * @property array[] $dependencies * @property string $runtime * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class BuildInstance extends InstanceResource { protected $_buildStatus; /** * Initialize the BuildInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the Build resource is * associated with * @param string $sid The SID of the Build resource to fetch */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the BuildInstance * * @return BuildInstance Fetched BuildInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): BuildInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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) . ']'; } } Serverless/V1/Service/BuildContext.php 0000644 00000007525 15107452344 0013722 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Serverless\V1\Service\Build\BuildStatusList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property BuildStatusList $buildStatus * @method \Twilio\Rest\Serverless\V1\Service\Build\BuildStatusContext buildStatus() */ class BuildContext extends InstanceContext { protected $_buildStatus; /** * Initialize the BuildContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the Build resource * from * @param string $sid The SID of the Build resource to fetch */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Builds/' . \rawurlencode($sid) . ''; } /** * Fetch the BuildInstance * * @return BuildInstance Fetched BuildInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): BuildInstance { $payload = $this->version->fetch('GET', $this->uri); return new BuildInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Delete the BuildInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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) . ']'; } } Serverless/V1/Service/Build/BuildStatusInstance.php 0000644 00000006543 15107452344 0016304 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Build; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $status * @property string $url */ class BuildStatusInstance extends InstanceResource { /** * Initialize the BuildStatusInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the Build resource is * associated with * @param string $sid The unique string that identifies the Build resource */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Serverless/V1/Service/Build/BuildStatusContext.php 0000644 00000003641 15107452344 0016160 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Build; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class BuildStatusContext extends InstanceContext { /** * Initialize the BuildStatusContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the Build resource * from * @param string $sid The SID of the Build resource to fetch */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Serverless/V1/Service/Build/BuildStatusPage.php 0000644 00000002633 15107452344 0015410 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Build; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class BuildStatusPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Serverless/V1/Service/Build/BuildStatusList.php 0000644 00000002637 15107452344 0015453 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Build; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class BuildStatusList extends ListResource { /** * Construct the BuildStatusList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the Build resource is * associated with * @param string $sid The unique string that identifies the Build resource */ public function __construct(Version $version, string $serviceSid, string $sid) { parent::__construct($version); // Path Solution $this->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]'; } } Serverless/V1/Service/EnvironmentOptions.php 0000644 00000003441 15107452344 0015167 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ abstract class EnvironmentOptions { /** * @param string $domainSuffix A URL-friendly name that represents the * environment * @return CreateEnvironmentOptions Options builder */ public static function create(string $domainSuffix = Values::NONE): CreateEnvironmentOptions { return new CreateEnvironmentOptions($domainSuffix); } } class CreateEnvironmentOptions extends Options { /** * @param string $domainSuffix A URL-friendly name that represents the * environment */ public function __construct(string $domainSuffix = Values::NONE) { $this->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 * @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 . ']'; } } Serverless/V1/Service/BuildPage.php 0000644 00000002431 15107452344 0013141 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class BuildPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Serverless/V1/Service/FunctionPage.php 0000644 00000002453 15107452344 0013673 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class FunctionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Serverless/V1/Service/BuildOptions.php 0000644 00000010473 15107452344 0013725 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ abstract class BuildOptions { /** * @param string[] $assetVersions The list of Asset Version resource SIDs to * include in the Build * @param string[] $functionVersions The list of the Function Version resource * SIDs to include in the Build * @param string $dependencies A list of objects that describe the Dependencies * included in the Build * @param string $runtime The Runtime version that will be used to run the * Build. * @return CreateBuildOptions Options builder */ public static function create(array $assetVersions = Values::ARRAY_NONE, array $functionVersions = Values::ARRAY_NONE, string $dependencies = Values::NONE, string $runtime = Values::NONE): CreateBuildOptions { return new CreateBuildOptions($assetVersions, $functionVersions, $dependencies, $runtime); } } class CreateBuildOptions extends Options { /** * @param string[] $assetVersions The list of Asset Version resource SIDs to * include in the Build * @param string[] $functionVersions The list of the Function Version resource * SIDs to include in the Build * @param string $dependencies A list of objects that describe the Dependencies * included in the Build * @param string $runtime The Runtime version that will be used to run the * Build. */ public function __construct(array $assetVersions = Values::ARRAY_NONE, array $functionVersions = Values::ARRAY_NONE, string $dependencies = Values::NONE, string $runtime = Values::NONE) { $this->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 * @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. * @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 . ']'; } } Serverless/V1/Service/AssetPage.php 0000644 00000002431 15107452344 0013161 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class AssetPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Serverless/V1/ServiceInstance.php 0000644 00000012363 15107452345 0013000 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Serverless\V1\Service\AssetList; use Twilio\Rest\Serverless\V1\Service\BuildList; use Twilio\Rest\Serverless\V1\Service\EnvironmentList; use Twilio\Rest\Serverless\V1\Service\FunctionList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $friendlyName * @property string $uniqueName * @property bool $includeCredentials * @property bool $uiEditable * @property string $domainBase * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class ServiceInstance extends InstanceResource { protected $_environments; protected $_functions; protected $_assets; protected $_builds; /** * Initialize the ServiceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the Service resource to fetch */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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 environments */ protected function getEnvironments(): EnvironmentList { return $this->proxy()->environments; } /** * Access the functions */ protected function getFunctions(): FunctionList { return $this->proxy()->functions; } /** * Access the assets */ protected function getAssets(): AssetList { return $this->proxy()->assets; } /** * Access the builds */ protected function getBuilds(): BuildList { return $this->proxy()->builds; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Serverless/V1/ServiceList.php 0000644 00000013314 15107452345 0012144 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ServiceList extends ListResource { /** * Construct the ServiceList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Services'; } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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); } /** * Create the ServiceInstance * * @param string $uniqueName A user-defined string that uniquely identifies the * Service resource * @param string $friendlyName A string to describe the Service resource * @param array|Options $options Optional Arguments * @return ServiceInstance 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']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ServiceInstance($this->version, $payload); } /** * Constructs a ServiceContext * * @param string $sid The SID of the Service resource to fetch */ 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]'; } } Serverless/V1/ServiceContext.php 0000644 00000013132 15107452345 0012653 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Serverless\V1\Service\AssetList; use Twilio\Rest\Serverless\V1\Service\BuildList; use Twilio\Rest\Serverless\V1\Service\EnvironmentList; use Twilio\Rest\Serverless\V1\Service\FunctionList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property EnvironmentList $environments * @property FunctionList $functions * @property AssetList $assets * @property BuildList $builds * @method \Twilio\Rest\Serverless\V1\Service\EnvironmentContext environments(string $sid) * @method \Twilio\Rest\Serverless\V1\Service\FunctionContext functions(string $sid) * @method \Twilio\Rest\Serverless\V1\Service\AssetContext assets(string $sid) * @method \Twilio\Rest\Serverless\V1\Service\BuildContext builds(string $sid) */ class ServiceContext extends InstanceContext { protected $_environments; protected $_functions; protected $_assets; protected $_builds; /** * Initialize the ServiceContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the Service resource to fetch */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($sid) . ''; } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { $payload = $this->version->fetch('GET', $this->uri); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ServiceInstance { $options = new Values($options); $data = Values::of([ 'IncludeCredentials' => Serialize::booleanToString($options['includeCredentials']), 'FriendlyName' => $options['friendlyName'], 'UiEditable' => Serialize::booleanToString($options['uiEditable']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Access the environments */ protected function getEnvironments(): EnvironmentList { if (!$this->_environments) { $this->_environments = new EnvironmentList($this->version, $this->solution['sid']); } return $this->_environments; } /** * Access the functions */ protected function getFunctions(): FunctionList { if (!$this->_functions) { $this->_functions = new FunctionList($this->version, $this->solution['sid']); } return $this->_functions; } /** * Access the assets */ protected function getAssets(): AssetList { if (!$this->_assets) { $this->_assets = new AssetList($this->version, $this->solution['sid']); } return $this->_assets; } /** * Access the builds */ protected function getBuilds(): BuildList { if (!$this->_builds) { $this->_builds = new BuildList($this->version, $this->solution['sid']); } return $this->_builds; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return 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) . ']'; } } Serverless/V1/ServiceOptions.php 0000644 00000013404 15107452345 0012664 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ abstract class ServiceOptions { /** * @param bool $includeCredentials Whether to inject Account credentials into a * function invocation context * @param bool $uiEditable Whether the Service's properties and subresources * can be edited via the UI * @return CreateServiceOptions Options builder */ public static function create(bool $includeCredentials = Values::NONE, bool $uiEditable = Values::NONE): CreateServiceOptions { return new CreateServiceOptions($includeCredentials, $uiEditable); } /** * @param bool $includeCredentials Whether to inject Account credentials into a * function invocation context * @param string $friendlyName A string to describe the Service resource * @param bool $uiEditable Whether the Service resource's properties and * subresources can be edited via the UI * @return UpdateServiceOptions Options builder */ public static function update(bool $includeCredentials = Values::NONE, string $friendlyName = Values::NONE, bool $uiEditable = Values::NONE): UpdateServiceOptions { return new UpdateServiceOptions($includeCredentials, $friendlyName, $uiEditable); } } class CreateServiceOptions extends Options { /** * @param bool $includeCredentials Whether to inject Account credentials into a * function invocation context * @param bool $uiEditable Whether the Service's properties and subresources * can be edited via the UI */ public function __construct(bool $includeCredentials = Values::NONE, bool $uiEditable = Values::NONE) { $this->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 * @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 * @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 string to describe the Service resource * @param bool $uiEditable Whether the Service resource's properties and * subresources can be edited via the UI */ public function __construct(bool $includeCredentials = Values::NONE, string $friendlyName = Values::NONE, bool $uiEditable = Values::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 string to describe the Service resource * @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 * @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 . ']'; } } Serverless/V1/ServicePage.php 0000644 00000002366 15107452345 0012112 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ServicePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Serverless/V1.php 0000644 00000004264 15107452345 0007714 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Serverless\V1\ServiceList; use Twilio\Version; /** * @property ServiceList $services * @method \Twilio\Rest\Serverless\V1\ServiceContext services(string $sid) */ class V1 extends Version { protected $_services; /** * Construct the V1 version of Serverless * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->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]'; } } Media/V1/MediaRecordingOptions.php 0000644 00000006372 15107452345 0013030 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Media\V1; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class MediaRecordingOptions { /** * @param string $order The sort order of the list * @param string $status Status to filter by * @param string $processorSid MediaProcessor to filter by * @param string $sourceSid Source SID to filter by * @return ReadMediaRecordingOptions Options builder */ public static function read(string $order = Values::NONE, string $status = Values::NONE, string $processorSid = Values::NONE, string $sourceSid = Values::NONE): ReadMediaRecordingOptions { return new ReadMediaRecordingOptions($order, $status, $processorSid, $sourceSid); } } class ReadMediaRecordingOptions extends Options { /** * @param string $order The sort order of the list * @param string $status Status to filter by * @param string $processorSid MediaProcessor to filter by * @param string $sourceSid Source SID to filter by */ public function __construct(string $order = Values::NONE, string $status = Values::NONE, string $processorSid = Values::NONE, string $sourceSid = Values::NONE) { $this->options['order'] = $order; $this->options['status'] = $status; $this->options['processorSid'] = $processorSid; $this->options['sourceSid'] = $sourceSid; } /** * The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. * * @param string $order The sort order of the list * @return $this Fluent Builder */ public function setOrder(string $order): self { $this->options['order'] = $order; return $this; } /** * Status to filter by, with possible values `processing`, `completed`, `deleted`, or `failed`. * * @param string $status Status to filter by * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * SID of a MediaProcessor to filter by. * * @param string $processorSid MediaProcessor to filter by * @return $this Fluent Builder */ public function setProcessorSid(string $processorSid): self { $this->options['processorSid'] = $processorSid; return $this; } /** * SID of a MediaRecording source to filter by. * * @param string $sourceSid Source SID to filter by * @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.Media.V1.ReadMediaRecordingOptions ' . $options . ']'; } } Media/V1/MediaRecordingList.php 0000644 00000012566 15107452345 0012312 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Media\V1; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class MediaRecordingList extends ListResource { /** * Construct the MediaRecordingList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/MediaRecordings'; } /** * Streams MediaRecordingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will 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']); } /** * Reads MediaRecordingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MediaRecordingInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of MediaRecordingInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MediaRecordingPage Page of MediaRecordingInstance */ public function page(array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): MediaRecordingPage { $options = new Values($options); $params = Values::of([ 'Order' => $options['order'], 'Status' => $options['status'], 'ProcessorSid' => $options['processorSid'], 'SourceSid' => $options['sourceSid'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MediaRecordingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MediaRecordingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MediaRecordingPage Page of MediaRecordingInstance */ public function getPage(string $targetUrl): MediaRecordingPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MediaRecordingPage($this->version, $response, $this->solution); } /** * Constructs a MediaRecordingContext * * @param string $sid The SID that identifies the resource to fetch */ public function getContext(string $sid): MediaRecordingContext { return new MediaRecordingContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Media.V1.MediaRecordingList]'; } } Media/V1/PlayerStreamer/PlaybackGrantPage.php 0000644 00000002320 15107452345 0015043 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Media\V1\PlayerStreamer; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class PlaybackGrantPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return PlaybackGrantInstance \Twilio\Rest\Media\V1\PlayerStreamer\PlaybackGrantInstance */ public function buildInstance(array $payload): PlaybackGrantInstance { return new PlaybackGrantInstance($this->version, $payload, $this->solution['sid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Media.V1.PlaybackGrantPage]'; } } Media/V1/PlayerStreamer/PlaybackGrantOptions.php 0000644 00000004647 15107452345 0015640 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Media\V1\PlayerStreamer; use Twilio\Options; use Twilio\Values; abstract class PlaybackGrantOptions { /** * @param int $ttl The time to live of the PlaybackGrant * @param string $accessControlAllowOrigin The full URL that is authorized to * play back the livestream * @return CreatePlaybackGrantOptions Options builder */ public static function create(int $ttl = Values::NONE, string $accessControlAllowOrigin = Values::NONE): CreatePlaybackGrantOptions { return new CreatePlaybackGrantOptions($ttl, $accessControlAllowOrigin); } } class CreatePlaybackGrantOptions extends Options { /** * @param int $ttl The time to live of the PlaybackGrant * @param string $accessControlAllowOrigin The full URL that is authorized to * play back the livestream */ public function __construct(int $ttl = Values::NONE, string $accessControlAllowOrigin = Values::NONE) { $this->options['ttl'] = $ttl; $this->options['accessControlAllowOrigin'] = $accessControlAllowOrigin; } /** * The time to live of the PlaybackGrant. Default value is 15 seconds. Maximum value is 60 seconds. * * @param int $ttl The time to live of the PlaybackGrant * @return $this Fluent Builder */ public function setTtl(int $ttl): self { $this->options['ttl'] = $ttl; return $this; } /** * The full origin URL where the livestream can be streamed. If this is not provided, it can be streamed from any domain. * * @param string $accessControlAllowOrigin The full URL that is authorized to * play back the livestream * @return $this Fluent Builder */ public function setAccessControlAllowOrigin(string $accessControlAllowOrigin): self { $this->options['accessControlAllowOrigin'] = $accessControlAllowOrigin; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Media.V1.CreatePlaybackGrantOptions ' . $options . ']'; } } Media/V1/PlayerStreamer/PlaybackGrantList.php 0000644 00000002155 15107452345 0015110 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Media\V1\PlayerStreamer; use Twilio\ListResource; use Twilio\Version; class PlaybackGrantList extends ListResource { /** * Construct the PlaybackGrantList * * @param Version $version Version that contains the resource * @param string $sid The unique string that identifies the PlayerStreamer * associated with this PlaybackGrant. */ public function __construct(Version $version, string $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; } /** * Constructs a PlaybackGrantContext */ public function getContext(): PlaybackGrantContext { return new PlaybackGrantContext($this->version, $this->solution['sid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Media.V1.PlaybackGrantList]'; } } Media/V1/PlayerStreamer/PlaybackGrantInstance.php 0000644 00000006752 15107452345 0015750 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Media\V1\PlayerStreamer; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $url * @property string $accountSid * @property \DateTime $dateCreated * @property array $grant */ class PlaybackGrantInstance extends InstanceResource { /** * Initialize the PlaybackGrantInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the PlayerStreamer * associated with this PlaybackGrant. */ public function __construct(Version $version, array $payload, string $sid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'url' => Values::array_get($payload, 'url'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'grant' => Values::array_get($payload, 'grant'), ]; $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 PlaybackGrantContext Context for this PlaybackGrantInstance */ protected function proxy(): PlaybackGrantContext { if (!$this->context) { $this->context = new PlaybackGrantContext($this->version, $this->solution['sid']); } return $this->context; } /** * Create the PlaybackGrantInstance * * @param array|Options $options Optional Arguments * @return PlaybackGrantInstance Created PlaybackGrantInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): PlaybackGrantInstance { return $this->proxy()->create($options); } /** * Fetch the PlaybackGrantInstance * * @return PlaybackGrantInstance Fetched PlaybackGrantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PlaybackGrantInstance { 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.Media.V1.PlaybackGrantInstance ' . \implode(' ', $context) . ']'; } } Media/V1/PlayerStreamer/PlaybackGrantContext.php 0000644 00000004356 15107452345 0015626 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Media\V1\PlayerStreamer; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class PlaybackGrantContext extends InstanceContext { /** * Initialize the PlaybackGrantContext * * @param Version $version Version that contains the resource * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/PlayerStreamers/' . \rawurlencode($sid) . '/PlaybackGrant'; } /** * Create the PlaybackGrantInstance * * @param array|Options $options Optional Arguments * @return PlaybackGrantInstance Created PlaybackGrantInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): PlaybackGrantInstance { $options = new Values($options); $data = Values::of([ 'Ttl' => $options['ttl'], 'AccessControlAllowOrigin' => $options['accessControlAllowOrigin'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new PlaybackGrantInstance($this->version, $payload, $this->solution['sid']); } /** * Fetch the PlaybackGrantInstance * * @return PlaybackGrantInstance Fetched PlaybackGrantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PlaybackGrantInstance { $payload = $this->version->fetch('GET', $this->uri); return new PlaybackGrantInstance($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.Media.V1.PlaybackGrantContext ' . \implode(' ', $context) . ']'; } } Media/V1/MediaProcessorPage.php 0000644 00000002240 15107452345 0012302 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Media\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MediaProcessorPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return MediaProcessorInstance \Twilio\Rest\Media\V1\MediaProcessorInstance */ public function buildInstance(array $payload): MediaProcessorInstance { return new MediaProcessorInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Media.V1.MediaProcessorPage]'; } } Media/V1/MediaRecordingInstance.php 0000644 00000011100 15107452345 0013122 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Media\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property int $duration * @property string $format * @property array $links * @property string $processorSid * @property string $resolution * @property string $sourceSid * @property string $sid * @property string $mediaSize * @property string $status * @property string $statusCallback * @property string $statusCallbackMethod * @property string $url */ class MediaRecordingInstance extends InstanceResource { /** * Initialize the MediaRecordingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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')), 'duration' => Values::array_get($payload, 'duration'), 'format' => Values::array_get($payload, 'format'), 'links' => Values::array_get($payload, 'links'), 'processorSid' => Values::array_get($payload, 'processor_sid'), 'resolution' => Values::array_get($payload, 'resolution'), 'sourceSid' => Values::array_get($payload, 'source_sid'), 'sid' => Values::array_get($payload, 'sid'), 'mediaSize' => Values::array_get($payload, 'media_size'), 'status' => Values::array_get($payload, 'status'), '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 MediaRecordingContext Context for this MediaRecordingInstance */ protected function proxy(): MediaRecordingContext { if (!$this->context) { $this->context = new MediaRecordingContext($this->version, $this->solution['sid']); } return $this->context; } /** * Delete the MediaRecordingInstance * * @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 MediaRecordingInstance * * @return MediaRecordingInstance Fetched MediaRecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MediaRecordingInstance { 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.Media.V1.MediaRecordingInstance ' . \implode(' ', $context) . ']'; } } Media/V1/MediaProcessorContext.php 0000644 00000004067 15107452345 0013063 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Media\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class MediaProcessorContext extends InstanceContext { /** * Initialize the MediaProcessorContext * * @param Version $version Version that contains the resource * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/MediaProcessors/' . \rawurlencode($sid) . ''; } /** * Fetch the MediaProcessorInstance * * @return MediaProcessorInstance Fetched MediaProcessorInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MediaProcessorInstance { $payload = $this->version->fetch('GET', $this->uri); return new MediaProcessorInstance($this->version, $payload, $this->solution['sid']); } /** * Update the MediaProcessorInstance * * @param string $status The status of the MediaProcessor * @return MediaProcessorInstance Updated MediaProcessorInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status): MediaProcessorInstance { $data = Values::of(['Status' => $status, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new MediaProcessorInstance($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.Media.V1.MediaProcessorContext ' . \implode(' ', $context) . ']'; } } Media/V1/PlayerStreamerOptions.php 0000644 00000013706 15107452345 0013112 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Media\V1; use Twilio\Options; use Twilio\Values; abstract class PlayerStreamerOptions { /** * @param bool $video Whether the PlayerStreamer is configured to stream video * @param string $statusCallback The URL to which Twilio will send * PlayerStreamer event updates * @param string $statusCallbackMethod The HTTP method Twilio should use to * call the `status_callback` URL * @param int $maxDuration Maximum PlayerStreamer duration in seconds * @return CreatePlayerStreamerOptions Options builder */ public static function create(bool $video = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, int $maxDuration = Values::NONE): CreatePlayerStreamerOptions { return new CreatePlayerStreamerOptions($video, $statusCallback, $statusCallbackMethod, $maxDuration); } /** * @param string $order The sort order of the list * @param string $status Status to filter by * @return ReadPlayerStreamerOptions Options builder */ public static function read(string $order = Values::NONE, string $status = Values::NONE): ReadPlayerStreamerOptions { return new ReadPlayerStreamerOptions($order, $status); } } class CreatePlayerStreamerOptions extends Options { /** * @param bool $video Whether the PlayerStreamer is configured to stream video * @param string $statusCallback The URL to which Twilio will send * PlayerStreamer event updates * @param string $statusCallbackMethod The HTTP method Twilio should use to * call the `status_callback` URL * @param int $maxDuration Maximum PlayerStreamer duration in seconds */ public function __construct(bool $video = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, int $maxDuration = Values::NONE) { $this->options['video'] = $video; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['maxDuration'] = $maxDuration; } /** * Specifies whether the PlayerStreamer is configured to stream video. Defaults to `true`. * * @param bool $video Whether the PlayerStreamer is configured to stream video * @return $this Fluent Builder */ public function setVideo(bool $video): self { $this->options['video'] = $video; return $this; } /** * The URL to which Twilio will send asynchronous webhook requests for every PlayerStreamer event. See [Status Callbacks](/docs/live/status-callbacks) for more details. * * @param string $statusCallback The URL to which Twilio will send * PlayerStreamer event updates * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method Twilio should use to call the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`. * * @param string $statusCallbackMethod The HTTP method Twilio should use to * call the `status_callback` URL * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The maximum time, in seconds, that the PlayerStreamer is active (`created` or `started`) before automatically ends. The default value is 300 seconds, and the maximum value is 90000 seconds. Once this maximum duration is reached, Twilio will end the PlayerStreamer, regardless of whether media is still streaming. * * @param int $maxDuration Maximum PlayerStreamer duration in seconds * @return $this Fluent Builder */ public function setMaxDuration(int $maxDuration): self { $this->options['maxDuration'] = $maxDuration; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Media.V1.CreatePlayerStreamerOptions ' . $options . ']'; } } class ReadPlayerStreamerOptions extends Options { /** * @param string $order The sort order of the list * @param string $status Status to filter by */ public function __construct(string $order = Values::NONE, string $status = Values::NONE) { $this->options['order'] = $order; $this->options['status'] = $status; } /** * The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. * * @param string $order The sort order of the list * @return $this Fluent Builder */ public function setOrder(string $order): self { $this->options['order'] = $order; return $this; } /** * Status to filter by, with possible values `created`, `started`, `ended`, or `failed`. * * @param string $status Status to filter by * @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.Media.V1.ReadPlayerStreamerOptions ' . $options . ']'; } } Media/V1/MediaRecordingContext.php 0000644 00000003773 15107452345 0013023 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Media\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class MediaRecordingContext extends InstanceContext { /** * Initialize the MediaRecordingContext * * @param Version $version Version that contains the resource * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/MediaRecordings/' . \rawurlencode($sid) . ''; } /** * Delete the MediaRecordingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the MediaRecordingInstance * * @return MediaRecordingInstance Fetched MediaRecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MediaRecordingInstance { $payload = $this->version->fetch('GET', $this->uri); return new MediaRecordingInstance($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.Media.V1.MediaRecordingContext ' . \implode(' ', $context) . ']'; } } Media/V1/PlayerStreamerPage.php 0000644 00000002240 15107452345 0012322 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Media\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class PlayerStreamerPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return PlayerStreamerInstance \Twilio\Rest\Media\V1\PlayerStreamerInstance */ public function buildInstance(array $payload): PlayerStreamerInstance { return new PlayerStreamerInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Media.V1.PlayerStreamerPage]'; } } Media/V1/MediaProcessorList.php 0000644 00000014317 15107452345 0012351 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Media\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class MediaProcessorList extends ListResource { /** * Construct the MediaProcessorList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/MediaProcessors'; } /** * Create the MediaProcessorInstance * * @param string $extension The Media Extension name or URL * @param string $extensionContext The Media Extension context * @param array|Options $options Optional Arguments * @return MediaProcessorInstance Created MediaProcessorInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $extension, string $extensionContext, array $options = []): MediaProcessorInstance { $options = new Values($options); $data = Values::of([ 'Extension' => $extension, 'ExtensionContext' => $extensionContext, 'ExtensionEnvironment' => Serialize::jsonObject($options['extensionEnvironment']), 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'MaxDuration' => $options['maxDuration'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new MediaProcessorInstance($this->version, $payload); } /** * Streams MediaProcessorInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will 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']); } /** * Reads MediaProcessorInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MediaProcessorInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of MediaProcessorInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MediaProcessorPage Page of MediaProcessorInstance */ public function page(array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): MediaProcessorPage { $options = new Values($options); $params = Values::of([ 'Order' => $options['order'], 'Status' => $options['status'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MediaProcessorPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MediaProcessorInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MediaProcessorPage Page of MediaProcessorInstance */ public function getPage(string $targetUrl): MediaProcessorPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MediaProcessorPage($this->version, $response, $this->solution); } /** * Constructs a MediaProcessorContext * * @param string $sid The SID that identifies the resource to fetch */ public function getContext(string $sid): MediaProcessorContext { return new MediaProcessorContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Media.V1.MediaProcessorList]'; } } Media/V1/MediaRecordingPage.php 0000644 00000002553 15107452345 0012246 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Media\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class MediaRecordingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return MediaRecordingInstance \Twilio\Rest\Media\V1\MediaRecordingInstance */ public function buildInstance(array $payload): MediaRecordingInstance { return new MediaRecordingInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Media.V1.MediaRecordingPage]'; } } Media/V1/PlayerStreamerList.php 0000644 00000013652 15107452345 0012372 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Media\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class PlayerStreamerList extends ListResource { /** * Construct the PlayerStreamerList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/PlayerStreamers'; } /** * Create the PlayerStreamerInstance * * @param array|Options $options Optional Arguments * @return PlayerStreamerInstance Created PlayerStreamerInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): PlayerStreamerInstance { $options = new Values($options); $data = Values::of([ 'Video' => Serialize::booleanToString($options['video']), 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'MaxDuration' => $options['maxDuration'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new PlayerStreamerInstance($this->version, $payload); } /** * Streams PlayerStreamerInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will 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']); } /** * Reads PlayerStreamerInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return PlayerStreamerInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of PlayerStreamerInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return PlayerStreamerPage Page of PlayerStreamerInstance */ public function page(array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): PlayerStreamerPage { $options = new Values($options); $params = Values::of([ 'Order' => $options['order'], 'Status' => $options['status'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new PlayerStreamerPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of PlayerStreamerInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return PlayerStreamerPage Page of PlayerStreamerInstance */ public function getPage(string $targetUrl): PlayerStreamerPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new PlayerStreamerPage($this->version, $response, $this->solution); } /** * Constructs a PlayerStreamerContext * * @param string $sid The SID that identifies the resource to fetch */ public function getContext(string $sid): PlayerStreamerContext { return new PlayerStreamerContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Media.V1.PlayerStreamerList]'; } } Media/V1/MediaProcessorInstance.php 0000644 00000010351 15107452345 0013174 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Media\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $sid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $extension * @property string $extensionContext * @property string $status * @property string $url * @property string $endedReason * @property string $statusCallback * @property string $statusCallbackMethod * @property int $maxDuration */ class MediaProcessorInstance extends InstanceResource { /** * Initialize the MediaProcessorInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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')), 'extension' => Values::array_get($payload, 'extension'), 'extensionContext' => Values::array_get($payload, 'extension_context'), 'status' => Values::array_get($payload, 'status'), 'url' => Values::array_get($payload, 'url'), 'endedReason' => Values::array_get($payload, 'ended_reason'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), 'maxDuration' => Values::array_get($payload, 'max_duration'), ]; $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 MediaProcessorContext Context for this MediaProcessorInstance */ protected function proxy(): MediaProcessorContext { if (!$this->context) { $this->context = new MediaProcessorContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch the MediaProcessorInstance * * @return MediaProcessorInstance Fetched MediaProcessorInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MediaProcessorInstance { return $this->proxy()->fetch(); } /** * Update the MediaProcessorInstance * * @param string $status The status of the MediaProcessor * @return MediaProcessorInstance Updated MediaProcessorInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status): MediaProcessorInstance { 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.Media.V1.MediaProcessorInstance ' . \implode(' ', $context) . ']'; } } Media/V1/PlayerStreamerContext.php 0000644 00000007342 15107452345 0013102 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Media\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Media\V1\PlayerStreamer\PlaybackGrantList; use Twilio\Values; use Twilio\Version; /** * @property PlaybackGrantList $playbackGrant * @method \Twilio\Rest\Media\V1\PlayerStreamer\PlaybackGrantContext playbackGrant() */ class PlayerStreamerContext extends InstanceContext { protected $_playbackGrant; /** * Initialize the PlayerStreamerContext * * @param Version $version Version that contains the resource * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/PlayerStreamers/' . \rawurlencode($sid) . ''; } /** * Fetch the PlayerStreamerInstance * * @return PlayerStreamerInstance Fetched PlayerStreamerInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PlayerStreamerInstance { $payload = $this->version->fetch('GET', $this->uri); return new PlayerStreamerInstance($this->version, $payload, $this->solution['sid']); } /** * Update the PlayerStreamerInstance * * @param string $status The status the PlayerStreamer should be transitioned to * @return PlayerStreamerInstance Updated PlayerStreamerInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status): PlayerStreamerInstance { $data = Values::of(['Status' => $status, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new PlayerStreamerInstance($this->version, $payload, $this->solution['sid']); } /** * Access the playbackGrant */ protected function getPlaybackGrant(): PlaybackGrantList { if (!$this->_playbackGrant) { $this->_playbackGrant = new PlaybackGrantList($this->version, $this->solution['sid']); } return $this->_playbackGrant; } /** * 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.Media.V1.PlayerStreamerContext ' . \implode(' ', $context) . ']'; } } Media/V1/PlayerStreamerInstance.php 0000644 00000010716 15107452345 0013221 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Media\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Rest\Media\V1\PlayerStreamer\PlaybackGrantList; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property bool $video * @property array $links * @property string $sid * @property string $status * @property string $url * @property string $statusCallback * @property string $statusCallbackMethod * @property string $endedReason * @property int $maxDuration */ class PlayerStreamerInstance extends InstanceResource { protected $_playbackGrant; /** * Initialize the PlayerStreamerInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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')), 'video' => Values::array_get($payload, 'video'), 'links' => Values::array_get($payload, 'links'), 'sid' => Values::array_get($payload, 'sid'), 'status' => Values::array_get($payload, 'status'), 'url' => Values::array_get($payload, 'url'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), 'endedReason' => Values::array_get($payload, 'ended_reason'), 'maxDuration' => Values::array_get($payload, 'max_duration'), ]; $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 PlayerStreamerContext Context for this PlayerStreamerInstance */ protected function proxy(): PlayerStreamerContext { if (!$this->context) { $this->context = new PlayerStreamerContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch the PlayerStreamerInstance * * @return PlayerStreamerInstance Fetched PlayerStreamerInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PlayerStreamerInstance { return $this->proxy()->fetch(); } /** * Update the PlayerStreamerInstance * * @param string $status The status the PlayerStreamer should be transitioned to * @return PlayerStreamerInstance Updated PlayerStreamerInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status): PlayerStreamerInstance { return $this->proxy()->update($status); } /** * Access the playbackGrant */ protected function getPlaybackGrant(): PlaybackGrantList { return $this->proxy()->playbackGrant; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Media.V1.PlayerStreamerInstance ' . \implode(' ', $context) . ']'; } } Media/V1/MediaProcessorOptions.php 0000644 00000014344 15107452345 0013071 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Media\V1; use Twilio\Options; use Twilio\Values; abstract class MediaProcessorOptions { /** * @param array $extensionEnvironment The Media Extension environment * @param string $statusCallback The URL to send MediaProcessor event updates * to your application * @param string $statusCallbackMethod The HTTP method Twilio should use to * call the `status_callback` URL * @param int $maxDuration Maximum MediaProcessor duration in minutes * @return CreateMediaProcessorOptions Options builder */ public static function create(array $extensionEnvironment = Values::ARRAY_NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, int $maxDuration = Values::NONE): CreateMediaProcessorOptions { return new CreateMediaProcessorOptions($extensionEnvironment, $statusCallback, $statusCallbackMethod, $maxDuration); } /** * @param string $order The sort order of the list * @param string $status Status to filter by * @return ReadMediaProcessorOptions Options builder */ public static function read(string $order = Values::NONE, string $status = Values::NONE): ReadMediaProcessorOptions { return new ReadMediaProcessorOptions($order, $status); } } class CreateMediaProcessorOptions extends Options { /** * @param array $extensionEnvironment The Media Extension environment * @param string $statusCallback The URL to send MediaProcessor event updates * to your application * @param string $statusCallbackMethod The HTTP method Twilio should use to * call the `status_callback` URL * @param int $maxDuration Maximum MediaProcessor duration in minutes */ public function __construct(array $extensionEnvironment = Values::ARRAY_NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, int $maxDuration = Values::NONE) { $this->options['extensionEnvironment'] = $extensionEnvironment; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['maxDuration'] = $maxDuration; } /** * User-defined environment variables for the Media Extension, represented as a JSON dictionary of key/value strings. See the documentation for the specific [Media Extension](/docs/live/api/media-extensions-overview) you are using for more information about whether you need to provide this. * * @param array $extensionEnvironment The Media Extension environment * @return $this Fluent Builder */ public function setExtensionEnvironment(array $extensionEnvironment): self { $this->options['extensionEnvironment'] = $extensionEnvironment; return $this; } /** * The URL to which Twilio will send asynchronous webhook requests for every MediaProcessor event. See [Status Callbacks](/docs/live/status-callbacks) for details. * * @param string $statusCallback The URL to send MediaProcessor event updates * to your application * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method Twilio should use to call the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`. * * @param string $statusCallbackMethod The HTTP method Twilio should use to * call the `status_callback` URL * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The maximum time, in seconds, that the MediaProcessor can run before automatically ends. The default value is 300 seconds, and the maximum value is 90000 seconds. Once this maximum duration is reached, Twilio will end the MediaProcessor, regardless of whether media is still streaming. * * @param int $maxDuration Maximum MediaProcessor duration in minutes * @return $this Fluent Builder */ public function setMaxDuration(int $maxDuration): self { $this->options['maxDuration'] = $maxDuration; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Media.V1.CreateMediaProcessorOptions ' . $options . ']'; } } class ReadMediaProcessorOptions extends Options { /** * @param string $order The sort order of the list * @param string $status Status to filter by */ public function __construct(string $order = Values::NONE, string $status = Values::NONE) { $this->options['order'] = $order; $this->options['status'] = $status; } /** * The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. * * @param string $order The sort order of the list * @return $this Fluent Builder */ public function setOrder(string $order): self { $this->options['order'] = $order; return $this; } /** * Status to filter by, with possible values `started`, `ended` or `failed`. * * @param string $status Status to filter by * @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.Media.V1.ReadMediaProcessorOptions ' . $options . ']'; } } Media/V1.php 0000644 00000006120 15107452345 0006567 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Media; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Media\V1\MediaProcessorList; use Twilio\Rest\Media\V1\MediaRecordingList; use Twilio\Rest\Media\V1\PlayerStreamerList; use Twilio\Version; /** * @property MediaProcessorList $mediaProcessor * @property MediaRecordingList $mediaRecording * @property PlayerStreamerList $playerStreamer * @method \Twilio\Rest\Media\V1\MediaProcessorContext mediaProcessor(string $sid) * @method \Twilio\Rest\Media\V1\MediaRecordingContext mediaRecording(string $sid) * @method \Twilio\Rest\Media\V1\PlayerStreamerContext playerStreamer(string $sid) */ class V1 extends Version { protected $_mediaProcessor; protected $_mediaRecording; protected $_playerStreamer; /** * Construct the V1 version of Media * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } protected function getMediaProcessor(): MediaProcessorList { if (!$this->_mediaProcessor) { $this->_mediaProcessor = new MediaProcessorList($this); } return $this->_mediaProcessor; } protected function getMediaRecording(): MediaRecordingList { if (!$this->_mediaRecording) { $this->_mediaRecording = new MediaRecordingList($this); } return $this->_mediaRecording; } protected function getPlayerStreamer(): PlayerStreamerList { if (!$this->_playerStreamer) { $this->_playerStreamer = new PlayerStreamerList($this); } return $this->_playerStreamer; } /** * 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.Media.V1]'; } } Messaging/V1/DomainConfigPage.php 0000644 00000002421 15107452345 0012617 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class DomainConfigPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Messaging/V1/BrandRegistrationContext.php 0000644 00000007400 15107452345 0014455 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Messaging\V1\BrandRegistration\BrandVettingList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property BrandVettingList $brandVettings * @method \Twilio\Rest\Messaging\V1\BrandRegistration\BrandVettingContext brandVettings(string $brandVettingSid) */ class BrandRegistrationContext extends InstanceContext { protected $_brandVettings; /** * Initialize the BrandRegistrationContext * * @param Version $version Version that contains the resource * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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 { $payload = $this->version->update('POST', $this->uri); return new BrandRegistrationInstance($this->version, $payload, $this->solution['sid']); } /** * 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) . ']'; } } Messaging/V1/ExternalCampaignList.php 0000644 00000003350 15107452345 0013545 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ExternalCampaignList extends ListResource { /** * Construct the ExternalCampaignList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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 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, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ExternalCampaignInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.ExternalCampaignList]'; } } Messaging/V1/TollfreeVerificationContext.php 0000644 00000007334 15107452345 0015161 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class TollfreeVerificationContext extends InstanceContext { /** * Initialize the TollfreeVerificationContext * * @param Version $version Version that contains the resource * @param string $sid Tollfree Verification Sid */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Tollfree/Verifications/' . \rawurlencode($sid) . ''; } /** * Fetch the TollfreeVerificationInstance * * @return TollfreeVerificationInstance Fetched TollfreeVerificationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TollfreeVerificationInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } Messaging/V1/ExternalCampaignPage.php 0000644 00000002451 15107452345 0013507 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ExternalCampaignPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Messaging/V1/BrandRegistrationList.php 0000644 00000013767 15107452345 0013761 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class BrandRegistrationList extends ListResource { /** * Construct the BrandRegistrationList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/a2p/BrandRegistrations'; } /** * 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']); } /** * 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); } /** * 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); } /** * 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']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new BrandRegistrationInstance($this->version, $payload); } /** * Constructs a BrandRegistrationContext * * @param string $sid The SID that identifies the 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]'; } } Messaging/V1/TollfreeVerificationInstance.php 0000644 00000016070 15107452345 0015276 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $customerProfileSid * @property string $trustProductSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $regulatedItemSid * @property string $businessName * @property string $businessStreetAddress * @property string $businessStreetAddress2 * @property string $businessCity * @property string $businessStateProvinceRegion * @property string $businessPostalCode * @property string $businessCountry * @property string $businessWebsite * @property string $businessContactFirstName * @property string $businessContactLastName * @property string $businessContactEmail * @property string $businessContactPhone * @property string $notificationEmail * @property string[] $useCaseCategories * @property string $useCaseSummary * @property string $productionMessageSample * @property string[] $optInImageUrls * @property string $optInType * @property string $messageVolume * @property string $additionalInformation * @property string $tollfreePhoneNumberSid * @property string $status * @property string $url * @property array $resourceLinks * @property string $externalReferenceId */ class TollfreeVerificationInstance extends InstanceResource { /** * Initialize the TollfreeVerificationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid Tollfree Verification Sid */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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'), '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; } /** * 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) . ']'; } } Messaging/V1/DeactivationsList.php 0000644 00000001645 15107452345 0013125 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\ListResource; use Twilio\Version; class DeactivationsList extends ListResource { /** * Construct the DeactivationsList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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]'; } } Messaging/V1/BrandRegistrationOptions.php 0000644 00000007206 15107452345 0014470 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ abstract class BrandRegistrationOptions { /** * @param string $brandType Type of brand being created. One of: "STANDARD", * "STARTER". * @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. * @param bool $skipAutomaticSecVet Skip Automatic Secondary Vetting * @return CreateBrandRegistrationOptions Options builder */ public static function create(string $brandType = Values::NONE, bool $mock = Values::NONE, bool $skipAutomaticSecVet = Values::NONE): CreateBrandRegistrationOptions { return new CreateBrandRegistrationOptions($brandType, $mock, $skipAutomaticSecVet); } } class CreateBrandRegistrationOptions extends Options { /** * @param string $brandType Type of brand being created. One of: "STANDARD", * "STARTER". * @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. * @param bool $skipAutomaticSecVet Skip Automatic Secondary Vetting */ public function __construct(string $brandType = Values::NONE, bool $mock = Values::NONE, bool $skipAutomaticSecVet = Values::NONE) { $this->options['brandType'] = $brandType; $this->options['mock'] = $mock; $this->options['skipAutomaticSecVet'] = $skipAutomaticSecVet; } /** * Type of brand being created. One of: "STANDARD", "STARTER". STARTER is for low volume, starter use cases. STANDARD is for all other use cases. * * @param string $brandType Type of brand being created. One of: "STANDARD", * "STARTER". * @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 Skip Automatic Secondary Vetting * @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 . ']'; } } Messaging/V1/BrandRegistrationPage.php 0000644 00000002457 15107452345 0013714 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class BrandRegistrationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Messaging/V1/Service/ShortCodeList.php 0000644 00000013046 15107452345 0013620 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ShortCodeList extends ListResource { /** * Construct the ShortCodeList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with */ public function __construct(Version $version, string $serviceSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/ShortCodes'; } /** * Create the ShortCodeInstance * * @param string $shortCodeSid The SID of the ShortCode 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, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ShortCodeInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams ShortCodeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 that identifies the resource to fetch */ 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]'; } } Messaging/V1/Service/AlphaSenderContext.php 0000644 00000004300 15107452345 0014616 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class AlphaSenderContext extends InstanceContext { /** * Initialize the AlphaSenderContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Messaging Service to fetch the * resource from * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/AlphaSenders/' . \rawurlencode($sid) . ''; } /** * Fetch the AlphaSenderInstance * * @return AlphaSenderInstance Fetched AlphaSenderInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AlphaSenderInstance { $payload = $this->version->fetch('GET', $this->uri); return new AlphaSenderInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Delete the AlphaSenderInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Messaging/V1/Service/UsAppToPersonList.php 0000644 00000016731 15107452345 0014454 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class UsAppToPersonList extends ListResource { /** * Construct the UsAppToPersonList * * @param Version $version Version that contains the resource * @param string $messagingServiceSid The SID of the Messaging Service the * resource is associated with */ public function __construct(Version $version, string $messagingServiceSid) { parent::__construct($version); // Path Solution $this->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 * @param string $messageFlow The message flow of the campaign * @param string[] $messageSamples Message samples * @param string $usAppToPersonUsecase A2P Campaign Use Case. * @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; }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new UsAppToPersonInstance($this->version, $payload, $this->solution['messagingServiceSid']); } /** * 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']); } /** * 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); } /** * 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 that identifies the US A2P Compliance resource to * fetch */ 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]'; } } Messaging/V1/Service/PhoneNumberPage.php 0000644 00000002472 15107452345 0014112 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class PhoneNumberPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Messaging/V1/Service/ShortCodePage.php 0000644 00000002456 15107452345 0013564 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ShortCodePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Messaging/V1/Service/UsAppToPersonOptions.php 0000644 00000014336 15107452345 0015173 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ abstract class UsAppToPersonOptions { /** * @param string $optInMessage Opt In Message * @param string $optOutMessage Opt Out Message * @param string $helpMessage Help Message * @param string[] $optInKeywords Opt In Keywords * @param string[] $optOutKeywords Opt Out Keywords * @param string[] $helpKeywords Help Keywords * @return CreateUsAppToPersonOptions Options builder */ public static function create(string $optInMessage = Values::NONE, string $optOutMessage = Values::NONE, string $helpMessage = Values::NONE, array $optInKeywords = Values::ARRAY_NONE, array $optOutKeywords = Values::ARRAY_NONE, array $helpKeywords = Values::ARRAY_NONE): CreateUsAppToPersonOptions { return new CreateUsAppToPersonOptions($optInMessage, $optOutMessage, $helpMessage, $optInKeywords, $optOutKeywords, $helpKeywords); } } class CreateUsAppToPersonOptions extends Options { /** * @param string $optInMessage Opt In Message * @param string $optOutMessage Opt Out Message * @param string $helpMessage Help Message * @param string[] $optInKeywords Opt In Keywords * @param string[] $optOutKeywords Opt Out Keywords * @param string[] $helpKeywords Help Keywords */ public function __construct(string $optInMessage = Values::NONE, string $optOutMessage = Values::NONE, string $helpMessage = Values::NONE, array $optInKeywords = Values::ARRAY_NONE, array $optOutKeywords = Values::ARRAY_NONE, array $helpKeywords = Values::ARRAY_NONE) { $this->options['optInMessage'] = $optInMessage; $this->options['optOutMessage'] = $optOutMessage; $this->options['helpMessage'] = $helpMessage; $this->options['optInKeywords'] = $optInKeywords; $this->options['optOutKeywords'] = $optOutKeywords; $this->options['helpKeywords'] = $helpKeywords; } /** * 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 Opt In Message * @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 Opt Out Message * @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 Help Message * @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 Opt In Keywords * @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 Opt Out Keywords * @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 Help Keywords * @return $this Fluent Builder */ public function setHelpKeywords(array $helpKeywords): self { $this->options['helpKeywords'] = $helpKeywords; return $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 . ']'; } } Messaging/V1/Service/PhoneNumberContext.php 0000644 00000004225 15107452345 0014660 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class PhoneNumberContext extends InstanceContext { /** * Initialize the PhoneNumberContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->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 { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the PhoneNumberInstance * * @return PhoneNumberInstance Fetched PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PhoneNumberInstance { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Messaging/V1/Service/UsAppToPersonInstance.php 0000644 00000014022 15107452345 0015274 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $brandRegistrationSid * @property string $messagingServiceSid * @property string $description * @property string[] $messageSamples * @property string $usAppToPersonUsecase * @property bool $hasEmbeddedLinks * @property bool $hasEmbeddedPhone * @property string $campaignStatus * @property string $campaignId * @property bool $isExternallyRegistered * @property array $rateLimits * @property string $messageFlow * @property string $optInMessage * @property string $optOutMessage * @property string $helpMessage * @property string[] $optInKeywords * @property string[] $optOutKeywords * @property string[] $helpKeywords * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property bool $mock */ class UsAppToPersonInstance extends InstanceResource { /** * Initialize the UsAppToPersonInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $messagingServiceSid The SID of the Messaging Service the * resource is associated with * @param string $sid The SID that identifies the US A2P Compliance resource to * fetch */ public function __construct(Version $version, array $payload, string $messagingServiceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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'), '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'), ]; $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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Messaging/V1/Service/AlphaSenderPage.php 0000644 00000002472 15107452345 0014056 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class AlphaSenderPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Messaging/V1/Service/ShortCodeContext.php 0000644 00000004201 15107452345 0014322 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ShortCodeContext extends InstanceContext { /** * Initialize the ShortCodeContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->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 { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the ShortCodeInstance * * @return ShortCodeInstance Fetched ShortCodeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ShortCodeInstance { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Messaging/V1/Service/UsAppToPersonUsecaseOptions.php 0000644 00000003253 15107452345 0016500 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ abstract class UsAppToPersonUsecaseOptions { /** * @param string $brandRegistrationSid A2P Brand Registration SID * @return FetchUsAppToPersonUsecaseOptions Options builder */ public static function fetch(string $brandRegistrationSid = Values::NONE): FetchUsAppToPersonUsecaseOptions { return new FetchUsAppToPersonUsecaseOptions($brandRegistrationSid); } } class FetchUsAppToPersonUsecaseOptions extends Options { /** * @param string $brandRegistrationSid A2P Brand Registration SID */ public function __construct(string $brandRegistrationSid = Values::NONE) { $this->options['brandRegistrationSid'] = $brandRegistrationSid; } /** * The unique string to identify the A2P brand. * * @param string $brandRegistrationSid A2P Brand Registration SID * @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 . ']'; } } Messaging/V1/Service/AlphaSenderList.php 0000644 00000013037 15107452345 0014114 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class AlphaSenderList extends ListResource { /** * Construct the AlphaSenderList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with */ public function __construct(Version $version, string $serviceSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/AlphaSenders'; } /** * Create the AlphaSenderInstance * * @param string $alphaSender The Alphanumeric Sender ID string * @return AlphaSenderInstance Created AlphaSenderInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $alphaSender): AlphaSenderInstance { $data = Values::of(['AlphaSender' => $alphaSender, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AlphaSenderInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams AlphaSenderInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 that identifies the resource to fetch */ 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]'; } } Messaging/V1/Service/PhoneNumberList.php 0000644 00000013145 15107452345 0014150 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class PhoneNumberList extends ListResource { /** * Construct the PhoneNumberList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with */ public function __construct(Version $version, string $serviceSid) { parent::__construct($version); // Path Solution $this->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, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new PhoneNumberInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams PhoneNumberInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 that identifies the resource to fetch */ 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]'; } } Messaging/V1/Service/UsAppToPersonPage.php 0000644 00000002517 15107452345 0014412 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class UsAppToPersonPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Messaging/V1/Service/UsAppToPersonUsecaseInstance.php 0000644 00000003754 15107452345 0016617 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property array[] $usAppToPersonUsecases */ class UsAppToPersonUsecaseInstance extends InstanceResource { /** * Initialize the UsAppToPersonUsecaseInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $messagingServiceSid The unique string that identifies the * resource */ public function __construct(Version $version, array $payload, string $messagingServiceSid) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Messaging/V1/Service/UsAppToPersonUsecaseList.php 0000644 00000003726 15107452345 0015765 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class UsAppToPersonUsecaseList extends ListResource { /** * Construct the UsAppToPersonUsecaseList * * @param Version $version Version that contains the resource * @param string $messagingServiceSid The unique string that identifies the * resource */ public function __construct(Version $version, string $messagingServiceSid) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->fetch('GET', $this->uri, $params); 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]'; } } Messaging/V1/Service/UsAppToPersonContext.php 0000644 00000004501 15107452345 0015155 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class UsAppToPersonContext extends InstanceContext { /** * Initialize the UsAppToPersonContext * * @param Version $version Version that contains the resource * @param string $messagingServiceSid The SID of the Messaging Service to fetch * the resource from * @param string $sid The SID that identifies the US A2P Compliance resource to * fetch */ public function __construct(Version $version, $messagingServiceSid, $sid) { parent::__construct($version); // Path Solution $this->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 { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the UsAppToPersonInstance * * @return UsAppToPersonInstance Fetched UsAppToPersonInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UsAppToPersonInstance { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Messaging/V1/Service/AlphaSenderInstance.php 0000644 00000010033 15107452345 0014736 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $alphaSender * @property string[] $capabilities * @property string $url */ class AlphaSenderInstance extends InstanceResource { /** * Initialize the AlphaSenderInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the AlphaSenderInstance * * @return AlphaSenderInstance Fetched AlphaSenderInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AlphaSenderInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Messaging/V1/Service/PhoneNumberInstance.php 0000644 00000010206 15107452345 0014774 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $phoneNumber * @property string $countryCode * @property string[] $capabilities * @property string $url */ class PhoneNumberInstance extends InstanceResource { /** * Initialize the PhoneNumberInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Messaging/V1/Service/ShortCodeInstance.php 0000644 00000010150 15107452345 0014442 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $shortCode * @property string $countryCode * @property string[] $capabilities * @property string $url */ class ShortCodeInstance extends InstanceResource { /** * Initialize the ShortCodeInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Messaging/V1/Service/UsAppToPersonUsecasePage.php 0000644 00000002647 15107452345 0015727 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class UsAppToPersonUsecasePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Messaging/V1/DeactivationsInstance.php 0000644 00000005123 15107452345 0013751 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $redirectTo */ class DeactivationsInstance extends InstanceResource { /** * Initialize the DeactivationsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Messaging/V1/ServiceInstance.php 0000644 00000016074 15107452345 0012563 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Messaging\V1\Service\AlphaSenderList; use Twilio\Rest\Messaging\V1\Service\PhoneNumberList; use Twilio\Rest\Messaging\V1\Service\ShortCodeList; use Twilio\Rest\Messaging\V1\Service\UsAppToPersonList; use Twilio\Rest\Messaging\V1\Service\UsAppToPersonUsecaseList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $inboundRequestUrl * @property string $inboundMethod * @property string $fallbackUrl * @property string $fallbackMethod * @property string $statusCallback * @property bool $stickySender * @property bool $mmsConverter * @property bool $smartEncoding * @property string $scanMessageContent * @property bool $fallbackToLongCode * @property bool $areaCodeGeomatch * @property bool $synchronousValidation * @property int $validityPeriod * @property string $url * @property array $links * @property string $usecase * @property bool $usAppToPersonRegistered * @property bool $useInboundWebhookOnNumber */ class ServiceInstance extends InstanceResource { protected $_phoneNumbers; protected $_shortCodes; protected $_alphaSenders; protected $_usAppToPerson; protected $_usAppToPersonUsecases; /** * Initialize the ServiceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Access the phoneNumbers */ protected function getPhoneNumbers(): PhoneNumberList { return $this->proxy()->phoneNumbers; } /** * Access the shortCodes */ protected function getShortCodes(): ShortCodeList { return $this->proxy()->shortCodes; } /** * Access the alphaSenders */ protected function getAlphaSenders(): AlphaSenderList { return $this->proxy()->alphaSenders; } /** * Access the usAppToPerson */ protected function getUsAppToPerson(): UsAppToPersonList { return $this->proxy()->usAppToPerson; } /** * Access the usAppToPersonUsecases */ protected function getUsAppToPersonUsecases(): UsAppToPersonUsecaseList { return $this->proxy()->usAppToPersonUsecases; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Messaging/V1/ServiceList.php 0000644 00000014672 15107452345 0011734 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ServiceList extends ListResource { /** * Construct the ServiceList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Services'; } /** * Create the ServiceInstance * * @param string $friendlyName A string to describe the resource * @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']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ServiceInstance($this->version, $payload); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 that identifies the resource to fetch */ 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]'; } } Messaging/V1/ServiceContext.php 0000644 00000016375 15107452345 0012447 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Messaging\V1\Service\AlphaSenderList; use Twilio\Rest\Messaging\V1\Service\PhoneNumberList; use Twilio\Rest\Messaging\V1\Service\ShortCodeList; use Twilio\Rest\Messaging\V1\Service\UsAppToPersonList; use Twilio\Rest\Messaging\V1\Service\UsAppToPersonUsecaseList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property PhoneNumberList $phoneNumbers * @property ShortCodeList $shortCodes * @property AlphaSenderList $alphaSenders * @property UsAppToPersonList $usAppToPerson * @property UsAppToPersonUsecaseList $usAppToPersonUsecases * @method \Twilio\Rest\Messaging\V1\Service\PhoneNumberContext phoneNumbers(string $sid) * @method \Twilio\Rest\Messaging\V1\Service\ShortCodeContext shortCodes(string $sid) * @method \Twilio\Rest\Messaging\V1\Service\AlphaSenderContext alphaSenders(string $sid) * @method \Twilio\Rest\Messaging\V1\Service\UsAppToPersonContext usAppToPerson(string $sid) */ class ServiceContext extends InstanceContext { protected $_phoneNumbers; protected $_shortCodes; protected $_alphaSenders; protected $_usAppToPerson; protected $_usAppToPersonUsecases; /** * Initialize the ServiceContext * * @param Version $version Version that contains the resource * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($sid) . ''; } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(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']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { $payload = $this->version->fetch('GET', $this->uri); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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 alphaSenders */ protected function getAlphaSenders(): AlphaSenderList { if (!$this->_alphaSenders) { $this->_alphaSenders = new AlphaSenderList($this->version, $this->solution['sid']); } return $this->_alphaSenders; } /** * Access the usAppToPerson */ protected function getUsAppToPerson(): UsAppToPersonList { if (!$this->_usAppToPerson) { $this->_usAppToPerson = new UsAppToPersonList($this->version, $this->solution['sid']); } return $this->_usAppToPerson; } /** * Access the usAppToPersonUsecases */ protected function getUsAppToPersonUsecases(): UsAppToPersonUsecaseList { if (!$this->_usAppToPersonUsecases) { $this->_usAppToPersonUsecases = new UsAppToPersonUsecaseList( $this->version, $this->solution['sid'] ); } return $this->_usAppToPersonUsecases; } /** * 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) . ']'; } } Messaging/V1/UsecaseList.php 0000644 00000002423 15107452345 0011713 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class UsecaseList extends ListResource { /** * Construct the UsecaseList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Services/Usecases'; } /** * Fetch the UsecaseInstance * * @return UsecaseInstance Fetched UsecaseInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UsecaseInstance { $payload = $this->version->fetch('GET', $this->uri); return new UsecaseInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.UsecaseList]'; } } Messaging/V1/DomainCertsInstance.php 0000644 00000010512 15107452345 0013362 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $domainSid * @property \DateTime $dateUpdated * @property \DateTime $dateExpires * @property \DateTime $dateCreated * @property string $domainName * @property string $certificateSid * @property string $url * @property bool $validated */ class DomainCertsInstance extends InstanceResource { /** * Initialize the DomainCertsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $domainSid Unique string used to identify the domain that this * certificate should be associated with. */ public function __construct(Version $version, array $payload, string $domainSid = null) { parent::__construct($version); // Marshaled Properties $this->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'), 'validated' => Values::array_get($payload, 'validated'), ]; $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; } /** * Update the DomainCertsInstance * * @param string $tlsCert Certificate and private key information for this * domain. * @return DomainCertsInstance Updated DomainCertsInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $tlsCert): DomainCertsInstance { return $this->proxy()->update($tlsCert); } /** * Fetch the DomainCertsInstance * * @return DomainCertsInstance Fetched DomainCertsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DomainCertsInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Messaging/V1/DomainConfigList.php 0000644 00000002312 15107452345 0012655 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class DomainConfigList extends ListResource { /** * Construct the DomainConfigList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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]'; } } Messaging/V1/TollfreeVerificationOptions.php 0000644 00000111530 15107452345 0015162 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ abstract class TollfreeVerificationOptions { /** * @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. * @return ReadTollfreeVerificationOptions Options builder */ public static function read(string $tollfreePhoneNumberSid = Values::NONE, string $status = Values::NONE): ReadTollfreeVerificationOptions { return new ReadTollfreeVerificationOptions($tollfreePhoneNumberSid, $status); } /** * @param string $customerProfileSid Customer's Profile Bundle BundleSid * @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 phone number of the contact for the * business or organization using the * Tollfree number * @param string $externalReferenceId An optional external reference ID * supplied by customer and echoed back on * status retrieval * @return CreateTollfreeVerificationOptions Options builder */ public static function create(string $customerProfileSid = 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 $externalReferenceId = Values::NONE): CreateTollfreeVerificationOptions { return new CreateTollfreeVerificationOptions($customerProfileSid, $businessStreetAddress, $businessStreetAddress2, $businessCity, $businessStateProvinceRegion, $businessPostalCode, $businessCountry, $additionalInformation, $businessContactFirstName, $businessContactLastName, $businessContactEmail, $businessContactPhone, $externalReferenceId); } /** * @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 Further explaination on 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 Describe how a user opts-in to text messages * @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 phone number of the contact for the * business or organization using the * Tollfree number * @return UpdateTollfreeVerificationOptions Options builder */ public static function update(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): UpdateTollfreeVerificationOptions { return new UpdateTollfreeVerificationOptions($businessName, $businessWebsite, $notificationEmail, $useCaseCategories, $useCaseSummary, $productionMessageSample, $optInImageUrls, $optInType, $messageVolume, $businessStreetAddress, $businessStreetAddress2, $businessCity, $businessStateProvinceRegion, $businessPostalCode, $businessCountry, $additionalInformation, $businessContactFirstName, $businessContactLastName, $businessContactEmail, $businessContactPhone); } } 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. */ public function __construct(string $tollfreePhoneNumberSid = Values::NONE, string $status = Values::NONE) { $this->options['tollfreePhoneNumberSid'] = $tollfreePhoneNumberSid; $this->options['status'] = $status; } /** * 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; } /** * 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 CreateTollfreeVerificationOptions extends Options { /** * @param string $customerProfileSid Customer's Profile Bundle BundleSid * @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 phone number of the contact for the * business or organization using the * Tollfree number * @param string $externalReferenceId An optional external reference ID * supplied by customer and echoed back on * status retrieval */ public function __construct(string $customerProfileSid = 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 $externalReferenceId = Values::NONE) { $this->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 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; } /** * 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 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 Further explaination on 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 Describe how a user opts-in to text messages * @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 phone number of the contact for the * business or organization using the * Tollfree number */ 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) { $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; } /** * 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 Further explaination on 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; } /** * Describe how a user opts-in to text messages. * * @param string $optInType Describe how a user opts-in to text messages * @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; } /** * 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 . ']'; } } Messaging/V1/DomainConfigContext.php 0000644 00000005456 15107452345 0013402 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class DomainConfigContext extends InstanceContext { /** * Initialize the DomainConfigContext * * @param Version $version Version that contains the resource * @param string $domainSid Unique string used to identify the domain that this * config should be associated with. */ public function __construct(Version $version, $domainSid) { parent::__construct($version); // Path Solution $this->solution = ['domainSid' => $domainSid, ]; $this->uri = '/LinkShortening/Domains/' . \rawurlencode($domainSid) . '/Config'; } /** * Update the DomainConfigInstance * * @param string[] $messagingServiceSids A list of messagingServiceSids (with * prefix MG) * @param array|Options $options Optional Arguments * @return DomainConfigInstance Updated DomainConfigInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $messagingServiceSids, array $options = []): DomainConfigInstance { $options = new Values($options); $data = Values::of([ 'MessagingServiceSids' => Serialize::map($messagingServiceSids, function($e) { return $e; }), 'FallbackUrl' => $options['fallbackUrl'], 'CallbackUrl' => $options['callbackUrl'], 'MessagingServiceSidsAction' => $options['messagingServiceSidsAction'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new DomainConfigInstance($this->version, $payload, $this->solution['domainSid']); } /** * Fetch the DomainConfigInstance * * @return DomainConfigInstance Fetched DomainConfigInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DomainConfigInstance { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Messaging/V1/DomainConfigOptions.php 0000644 00000010226 15107452345 0013400 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ abstract class DomainConfigOptions { /** * @param string $fallbackUrl We will redirect requests to urls we are unable * to identify to this url. * @param string $callbackUrl URL to receive click events to your webhook * whenever the recipients click on the shortened * links * @param string $messagingServiceSidsAction An action type for * messaging_service_sids operation * (ADD, DELETE, REPLACE) * @return UpdateDomainConfigOptions Options builder */ public static function update(string $fallbackUrl = Values::NONE, string $callbackUrl = Values::NONE, string $messagingServiceSidsAction = Values::NONE): UpdateDomainConfigOptions { return new UpdateDomainConfigOptions($fallbackUrl, $callbackUrl, $messagingServiceSidsAction); } } class UpdateDomainConfigOptions extends Options { /** * @param string $fallbackUrl We will redirect requests to urls we are unable * to identify to this url. * @param string $callbackUrl URL to receive click events to your webhook * whenever the recipients click on the shortened * links * @param string $messagingServiceSidsAction An action type for * messaging_service_sids operation * (ADD, DELETE, REPLACE) */ public function __construct(string $fallbackUrl = Values::NONE, string $callbackUrl = Values::NONE, string $messagingServiceSidsAction = Values::NONE) { $this->options['fallbackUrl'] = $fallbackUrl; $this->options['callbackUrl'] = $callbackUrl; $this->options['messagingServiceSidsAction'] = $messagingServiceSidsAction; } /** * 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 We will redirect requests to urls we are unable * to identify to this url. * @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; } /** * An action type for messaging_service_sids operation (ADD, DELETE, REPLACE) * * @param string $messagingServiceSidsAction An action type for * messaging_service_sids operation * (ADD, DELETE, REPLACE) * @return $this Fluent Builder */ public function setMessagingServiceSidsAction(string $messagingServiceSidsAction): self { $this->options['messagingServiceSidsAction'] = $messagingServiceSidsAction; return $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 . ']'; } } Messaging/V1/TollfreeVerificationList.php 0000644 00000022344 15107452345 0014446 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class TollfreeVerificationList extends ListResource { /** * Construct the TollfreeVerificationList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Tollfree/Verifications'; } /** * 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']); } /** * 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); } /** * Retrieve a single page of TollfreeVerificationInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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'], '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); } /** * 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 Further explaination on 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 Describe how a user opts-in to text messages * @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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new TollfreeVerificationInstance($this->version, $payload); } /** * Constructs a TollfreeVerificationContext * * @param string $sid Tollfree Verification Sid */ 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]'; } } Messaging/V1/DomainCertsList.php 0000644 00000002311 15107452345 0012527 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class DomainCertsList extends ListResource { /** * Construct the DomainCertsList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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]'; } } Messaging/V1/DeactivationsContext.php 0000644 00000003174 15107452345 0013635 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class DeactivationsContext extends InstanceContext { /** * Initialize the DeactivationsContext * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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']), ]); $payload = $this->version->fetch('GET', $this->uri, $params); 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) . ']'; } } Messaging/V1/TollfreeVerificationPage.php 0000644 00000002501 15107452345 0014400 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class TollfreeVerificationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Messaging/V1/DeactivationsPage.php 0000644 00000002246 15107452345 0013064 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class DeactivationsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Messaging/V1/UsecasePage.php 0000644 00000002363 15107452345 0011657 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class UsecasePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Messaging/V1/DomainCertsPage.php 0000644 00000002413 15107452345 0012473 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class DomainCertsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Messaging/V1/DeactivationsOptions.php 0000644 00000003032 15107452345 0013635 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Options; use Twilio\Values; abstract class DeactivationsOptions { /** * @param \DateTime $date The date to retrieve deactivated numbers for. * @return FetchDeactivationsOptions Options builder */ public static function fetch(\DateTime $date = Values::NONE): FetchDeactivationsOptions { return new FetchDeactivationsOptions($date); } } class FetchDeactivationsOptions extends Options { /** * @param \DateTime $date The date to retrieve deactivated numbers for. */ public function __construct(\DateTime $date = Values::NONE) { $this->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 date to retrieve deactivated numbers for. * @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 . ']'; } } Messaging/V1/ServiceOptions.php 0000644 00000104630 15107452345 0012446 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ abstract class ServiceOptions { /** * @param string $inboundRequestUrl The URL we call using inbound_method when a * message is received by any phone number or * short code in the Service. This field will * be overridden if the * `use_inbound_webhook_on_number` field is * enabled. * @param string $inboundMethod The HTTP method we should use to call * inbound_request_url * @param string $fallbackUrl The URL that we call using fallback_method if an * error occurs while retrieving or executing the * TwiML from the Inbound Request URL. This field * will be overridden if the * `use_inbound_webhook_on_number` field is enabled. * @param string $fallbackMethod The HTTP method we should use to call * fallback_url * @param string $statusCallback The URL we should call to pass status updates * about message delivery * @param bool $stickySender Whether to enable Sticky Sender on the Service * instance * @param bool $mmsConverter Whether to enable the MMS Converter for messages * sent through the Service instance * @param bool $smartEncoding Whether to enable Encoding for messages sent * through the Service instance * @param string $scanMessageContent Reserved * @param bool $fallbackToLongCode Whether to enable Fallback to Long Code for * messages sent through the Service instance * @param bool $areaCodeGeomatch Whether to enable Area Code Geomatch on the * Service Instance * @param int $validityPeriod How long, in seconds, messages sent from the * Service are valid * @param bool $synchronousValidation Reserved * @param string $usecase A string describing the scenario in which the * Messaging Service will be used * @param bool $useInboundWebhookOnNumber If enabled, the webhook url * configured on the phone number will * be used and will override the * `inbound_request_url`/`fallback_url` * url called when an inbound message is * received. * @return CreateServiceOptions Options builder */ public static function create(string $inboundRequestUrl = Values::NONE, string $inboundMethod = Values::NONE, string $fallbackUrl = Values::NONE, string $fallbackMethod = Values::NONE, string $statusCallback = Values::NONE, bool $stickySender = Values::NONE, bool $mmsConverter = Values::NONE, bool $smartEncoding = Values::NONE, string $scanMessageContent = Values::NONE, bool $fallbackToLongCode = Values::NONE, bool $areaCodeGeomatch = Values::NONE, int $validityPeriod = Values::NONE, bool $synchronousValidation = Values::NONE, string $usecase = Values::NONE, bool $useInboundWebhookOnNumber = Values::NONE): CreateServiceOptions { return new CreateServiceOptions($inboundRequestUrl, $inboundMethod, $fallbackUrl, $fallbackMethod, $statusCallback, $stickySender, $mmsConverter, $smartEncoding, $scanMessageContent, $fallbackToLongCode, $areaCodeGeomatch, $validityPeriod, $synchronousValidation, $usecase, $useInboundWebhookOnNumber); } /** * @param string $friendlyName A string to describe the resource * @param string $inboundRequestUrl The URL we call using inbound_method when a * message is received by any phone number or * short code in the Service. This field will * be overridden if the * `use_inbound_webhook_on_number` field is * enabled. * @param string $inboundMethod The HTTP method we should use to call * inbound_request_url * @param string $fallbackUrl The URL that we call using fallback_method if an * error occurs while retrieving or executing the * TwiML from the Inbound Request URL. This field * will be overridden if the * `use_inbound_webhook_on_number` field is enabled. * @param string $fallbackMethod The HTTP method we should use to call * fallback_url * @param string $statusCallback The URL we should call to pass status updates * about message delivery * @param bool $stickySender Whether to enable Sticky Sender on the Service * instance * @param bool $mmsConverter Whether to enable the MMS Converter for messages * sent through the Service instance * @param bool $smartEncoding Whether to enable Encoding for messages sent * through the Service instance * @param string $scanMessageContent Reserved * @param bool $fallbackToLongCode Whether to enable Fallback to Long Code for * messages sent through the Service instance * @param bool $areaCodeGeomatch Whether to enable Area Code Geomatch on the * Service Instance * @param int $validityPeriod How long, in seconds, messages sent from the * Service are valid * @param bool $synchronousValidation Reserved * @param string $usecase A string describing the scenario in which the * Messaging Service will be used * @param bool $useInboundWebhookOnNumber If enabled, the webhook url * configured on the phone number will * be used and will override the * `inbound_request_url`/`fallback_url` * url called when an inbound message is * received. * @return UpdateServiceOptions Options builder */ public static function update(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::NONE, bool $mmsConverter = Values::NONE, bool $smartEncoding = Values::NONE, string $scanMessageContent = Values::NONE, bool $fallbackToLongCode = Values::NONE, bool $areaCodeGeomatch = Values::NONE, int $validityPeriod = Values::NONE, bool $synchronousValidation = Values::NONE, string $usecase = Values::NONE, bool $useInboundWebhookOnNumber = Values::NONE): UpdateServiceOptions { return new UpdateServiceOptions($friendlyName, $inboundRequestUrl, $inboundMethod, $fallbackUrl, $fallbackMethod, $statusCallback, $stickySender, $mmsConverter, $smartEncoding, $scanMessageContent, $fallbackToLongCode, $areaCodeGeomatch, $validityPeriod, $synchronousValidation, $usecase, $useInboundWebhookOnNumber); } } class CreateServiceOptions extends Options { /** * @param string $inboundRequestUrl The URL we call using inbound_method when a * message is received by any phone number or * short code in the Service. This field will * be overridden if the * `use_inbound_webhook_on_number` field is * enabled. * @param string $inboundMethod The HTTP method we should use to call * inbound_request_url * @param string $fallbackUrl The URL that we call using fallback_method if an * error occurs while retrieving or executing the * TwiML from the Inbound Request URL. This field * will be overridden if the * `use_inbound_webhook_on_number` field is enabled. * @param string $fallbackMethod The HTTP method we should use to call * fallback_url * @param string $statusCallback The URL we should call to pass status updates * about message delivery * @param bool $stickySender Whether to enable Sticky Sender on the Service * instance * @param bool $mmsConverter Whether to enable the MMS Converter for messages * sent through the Service instance * @param bool $smartEncoding Whether to enable Encoding for messages sent * through the Service instance * @param string $scanMessageContent Reserved * @param bool $fallbackToLongCode Whether to enable Fallback to Long Code for * messages sent through the Service instance * @param bool $areaCodeGeomatch Whether to enable Area Code Geomatch on the * Service Instance * @param int $validityPeriod How long, in seconds, messages sent from the * Service are valid * @param bool $synchronousValidation Reserved * @param string $usecase A string describing the scenario in which the * Messaging Service will be used * @param bool $useInboundWebhookOnNumber If enabled, the webhook url * configured on the phone number will * be used and will override the * `inbound_request_url`/`fallback_url` * url called when an inbound message is * received. */ public function __construct(string $inboundRequestUrl = Values::NONE, string $inboundMethod = Values::NONE, string $fallbackUrl = Values::NONE, string $fallbackMethod = Values::NONE, string $statusCallback = Values::NONE, bool $stickySender = Values::NONE, bool $mmsConverter = Values::NONE, bool $smartEncoding = Values::NONE, string $scanMessageContent = Values::NONE, bool $fallbackToLongCode = Values::NONE, bool $areaCodeGeomatch = Values::NONE, int $validityPeriod = Values::NONE, bool $synchronousValidation = Values::NONE, string $usecase = Values::NONE, bool $useInboundWebhookOnNumber = Values::NONE) { $this->options['inboundRequestUrl'] = $inboundRequestUrl; $this->options['inboundMethod'] = $inboundMethod; $this->options['fallbackUrl'] = $fallbackUrl; $this->options['fallbackMethod'] = $fallbackMethod; $this->options['statusCallback'] = $statusCallback; $this->options['stickySender'] = $stickySender; $this->options['mmsConverter'] = $mmsConverter; $this->options['smartEncoding'] = $smartEncoding; $this->options['scanMessageContent'] = $scanMessageContent; $this->options['fallbackToLongCode'] = $fallbackToLongCode; $this->options['areaCodeGeomatch'] = $areaCodeGeomatch; $this->options['validityPeriod'] = $validityPeriod; $this->options['synchronousValidation'] = $synchronousValidation; $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. This field will * be overridden if the * `use_inbound_webhook_on_number` field is * enabled. * @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 * @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. This field * will be overridden if the * `use_inbound_webhook_on_number` field is enabled. * @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 * @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 * 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/sms/services#sticky-sender) on the Service instance. * * @param bool $stickySender Whether to enable Sticky Sender on the Service * instance * @return $this Fluent Builder */ public function setStickySender(bool $stickySender): self { $this->options['stickySender'] = $stickySender; return $this; } /** * Whether to enable the [MMS Converter](https://www.twilio.com/docs/sms/services#mms-converter) for messages sent through the Service instance. * * @param bool $mmsConverter Whether to enable the MMS Converter for messages * sent through the Service instance * @return $this Fluent Builder */ public function setMmsConverter(bool $mmsConverter): self { $this->options['mmsConverter'] = $mmsConverter; return $this; } /** * Whether to enable [Smart Encoding](https://www.twilio.com/docs/sms/services#smart-encoding) for messages sent through the Service instance. * * @param bool $smartEncoding Whether to enable Encoding for messages sent * through the Service instance * @return $this Fluent Builder */ public function setSmartEncoding(bool $smartEncoding): self { $this->options['smartEncoding'] = $smartEncoding; return $this; } /** * Reserved. * * @param string $scanMessageContent Reserved * @return $this Fluent Builder */ public function setScanMessageContent(string $scanMessageContent): self { $this->options['scanMessageContent'] = $scanMessageContent; return $this; } /** * Whether to enable [Fallback to Long Code](https://www.twilio.com/docs/sms/services#fallback-to-long-code) for messages sent through the Service instance. * * @param bool $fallbackToLongCode Whether to enable Fallback to Long Code for * messages sent through the Service instance * @return $this Fluent Builder */ public function setFallbackToLongCode(bool $fallbackToLongCode): self { $this->options['fallbackToLongCode'] = $fallbackToLongCode; return $this; } /** * Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/sms/services#area-code-geomatch) on the Service Instance. * * @param bool $areaCodeGeomatch Whether to enable Area Code Geomatch on the * Service Instance * @return $this Fluent Builder */ public function setAreaCodeGeomatch(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 * @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. Examples: [notification, marketing, verification, poll ..]. * * @param string $usecase A string describing the scenario in which the * Messaging Service will be used * @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 If enabled, the webhook url * configured on the phone number will * be used and will override the * `inbound_request_url`/`fallback_url` * url called when an inbound message is * received. * @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 string to describe the resource * @param string $inboundRequestUrl The URL we call using inbound_method when a * message is received by any phone number or * short code in the Service. This field will * be overridden if the * `use_inbound_webhook_on_number` field is * enabled. * @param string $inboundMethod The HTTP method we should use to call * inbound_request_url * @param string $fallbackUrl The URL that we call using fallback_method if an * error occurs while retrieving or executing the * TwiML from the Inbound Request URL. This field * will be overridden if the * `use_inbound_webhook_on_number` field is enabled. * @param string $fallbackMethod The HTTP method we should use to call * fallback_url * @param string $statusCallback The URL we should call to pass status updates * about message delivery * @param bool $stickySender Whether to enable Sticky Sender on the Service * instance * @param bool $mmsConverter Whether to enable the MMS Converter for messages * sent through the Service instance * @param bool $smartEncoding Whether to enable Encoding for messages sent * through the Service instance * @param string $scanMessageContent Reserved * @param bool $fallbackToLongCode Whether to enable Fallback to Long Code for * messages sent through the Service instance * @param bool $areaCodeGeomatch Whether to enable Area Code Geomatch on the * Service Instance * @param int $validityPeriod How long, in seconds, messages sent from the * Service are valid * @param bool $synchronousValidation Reserved * @param string $usecase A string describing the scenario in which the * Messaging Service will be used * @param bool $useInboundWebhookOnNumber If enabled, the webhook url * configured on the phone number will * be used and will override the * `inbound_request_url`/`fallback_url` * url called when an inbound message is * received. */ 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::NONE, bool $mmsConverter = Values::NONE, bool $smartEncoding = Values::NONE, string $scanMessageContent = Values::NONE, bool $fallbackToLongCode = Values::NONE, bool $areaCodeGeomatch = Values::NONE, int $validityPeriod = Values::NONE, bool $synchronousValidation = Values::NONE, string $usecase = Values::NONE, bool $useInboundWebhookOnNumber = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['inboundRequestUrl'] = $inboundRequestUrl; $this->options['inboundMethod'] = $inboundMethod; $this->options['fallbackUrl'] = $fallbackUrl; $this->options['fallbackMethod'] = $fallbackMethod; $this->options['statusCallback'] = $statusCallback; $this->options['stickySender'] = $stickySender; $this->options['mmsConverter'] = $mmsConverter; $this->options['smartEncoding'] = $smartEncoding; $this->options['scanMessageContent'] = $scanMessageContent; $this->options['fallbackToLongCode'] = $fallbackToLongCode; $this->options['areaCodeGeomatch'] = $areaCodeGeomatch; $this->options['validityPeriod'] = $validityPeriod; $this->options['synchronousValidation'] = $synchronousValidation; $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 string to describe the resource * @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. This field will * be overridden if the * `use_inbound_webhook_on_number` field is * enabled. * @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 * @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. This field * will be overridden if the * `use_inbound_webhook_on_number` field is enabled. * @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 * @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 * 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/sms/services#sticky-sender) on the Service instance. * * @param bool $stickySender Whether to enable Sticky Sender on the Service * instance * @return $this Fluent Builder */ public function setStickySender(bool $stickySender): self { $this->options['stickySender'] = $stickySender; return $this; } /** * Whether to enable the [MMS Converter](https://www.twilio.com/docs/sms/services#mms-converter) for messages sent through the Service instance. * * @param bool $mmsConverter Whether to enable the MMS Converter for messages * sent through the Service instance * @return $this Fluent Builder */ public function setMmsConverter(bool $mmsConverter): self { $this->options['mmsConverter'] = $mmsConverter; return $this; } /** * Whether to enable [Smart Encoding](https://www.twilio.com/docs/sms/services#smart-encoding) for messages sent through the Service instance. * * @param bool $smartEncoding Whether to enable Encoding for messages sent * through the Service instance * @return $this Fluent Builder */ public function setSmartEncoding(bool $smartEncoding): self { $this->options['smartEncoding'] = $smartEncoding; return $this; } /** * Reserved. * * @param string $scanMessageContent Reserved * @return $this Fluent Builder */ public function setScanMessageContent(string $scanMessageContent): self { $this->options['scanMessageContent'] = $scanMessageContent; return $this; } /** * Whether to enable [Fallback to Long Code](https://www.twilio.com/docs/sms/services#fallback-to-long-code) for messages sent through the Service instance. * * @param bool $fallbackToLongCode Whether to enable Fallback to Long Code for * messages sent through the Service instance * @return $this Fluent Builder */ public function setFallbackToLongCode(bool $fallbackToLongCode): self { $this->options['fallbackToLongCode'] = $fallbackToLongCode; return $this; } /** * Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/sms/services#area-code-geomatch) on the Service Instance. * * @param bool $areaCodeGeomatch Whether to enable Area Code Geomatch on the * Service Instance * @return $this Fluent Builder */ public function setAreaCodeGeomatch(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 * @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. Examples: [notification, marketing, verification, poll ..] * * @param string $usecase A string describing the scenario in which the * Messaging Service will be used * @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 If enabled, the webhook url * configured on the phone number will * be used and will override the * `inbound_request_url`/`fallback_url` * url called when an inbound message is * received. * @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 . ']'; } } Messaging/V1/ExternalCampaignInstance.php 0000644 00000004277 15107452345 0014407 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $campaignId * @property string $messagingServiceSid * @property \DateTime $dateCreated */ class ExternalCampaignInstance extends InstanceResource { /** * Initialize the ExternalCampaignInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Messaging/V1/ServicePage.php 0000644 00000002363 15107452346 0011670 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ServicePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Messaging/V1/DomainCertsContext.php 0000644 00000005152 15107452346 0013247 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class DomainCertsContext extends InstanceContext { /** * Initialize the DomainCertsContext * * @param Version $version Version that contains the resource * @param string $domainSid Unique string used to identify the domain that this * certificate should be associated with. */ public function __construct(Version $version, $domainSid) { parent::__construct($version); // Path Solution $this->solution = ['domainSid' => $domainSid, ]; $this->uri = '/LinkShortening/Domains/' . \rawurlencode($domainSid) . '/Certificate'; } /** * Update the DomainCertsInstance * * @param string $tlsCert Certificate and private key information for this * domain. * @return DomainCertsInstance Updated DomainCertsInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $tlsCert): DomainCertsInstance { $data = Values::of(['TlsCert' => $tlsCert, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new DomainCertsInstance($this->version, $payload, $this->solution['domainSid']); } /** * Fetch the DomainCertsInstance * * @return DomainCertsInstance Fetched DomainCertsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DomainCertsInstance { $payload = $this->version->fetch('GET', $this->uri); return new DomainCertsInstance($this->version, $payload, $this->solution['domainSid']); } /** * Delete the DomainCertsInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Messaging/V1/BrandRegistration/BrandVettingOptions.php 0000644 00000005426 15107452346 0017062 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\BrandRegistration; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ abstract class BrandVettingOptions { /** * @param string $vettingId The unique ID of the vetting * @return CreateBrandVettingOptions Options builder */ public static function create(string $vettingId = Values::NONE): CreateBrandVettingOptions { return new CreateBrandVettingOptions($vettingId); } /** * @param string $vettingProvider Third-party provider of the vettings to create * @return ReadBrandVettingOptions Options builder */ public static function read(string $vettingProvider = Values::NONE): ReadBrandVettingOptions { return new ReadBrandVettingOptions($vettingProvider); } } class CreateBrandVettingOptions extends Options { /** * @param string $vettingId The unique ID of the vetting */ public function __construct(string $vettingId = Values::NONE) { $this->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 Third-party provider of the vettings to create */ public function __construct(string $vettingProvider = Values::NONE) { $this->options['vettingProvider'] = $vettingProvider; } /** * The third-party provider of the vettings to read * * @param string $vettingProvider Third-party provider of the vettings to create * @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 . ']'; } } Messaging/V1/BrandRegistration/BrandVettingList.php 0000644 00000014161 15107452346 0016336 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\BrandRegistration; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class BrandVettingList extends ListResource { /** * Construct the BrandVettingList * * @param Version $version Version that contains the resource * @param string $brandSid A2P BrandRegistration Sid */ public function __construct(Version $version, string $brandSid) { parent::__construct($version); // Path Solution $this->solution = ['brandSid' => $brandSid, ]; $this->uri = '/a2p/BrandRegistrations/' . \rawurlencode($brandSid) . '/Vettings'; } /** * Create the BrandVettingInstance * * @param string $vettingProvider Third-party provider of the vettings to create * @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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new BrandVettingInstance($this->version, $payload, $this->solution['brandSid']); } /** * 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']); } /** * 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); } /** * Retrieve a single page of BrandVettingInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 SID for 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]'; } } Messaging/V1/BrandRegistration/BrandVettingInstance.php 0000644 00000010071 15107452346 0017163 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\BrandRegistration; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $accountSid * @property string $brandSid * @property string $brandVettingSid * @property \DateTime $dateUpdated * @property \DateTime $dateCreated * @property string $vettingId * @property string $vettingClass * @property string $vettingStatus * @property string $vettingProvider * @property string $url */ class BrandVettingInstance extends InstanceResource { /** * Initialize the BrandVettingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $brandSid A2P BrandRegistration Sid * @param string $brandVettingSid SID for third-party vetting record */ public function __construct(Version $version, array $payload, string $brandSid, string $brandVettingSid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Messaging/V1/BrandRegistration/BrandVettingContext.php 0000644 00000003655 15107452346 0017055 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\BrandRegistration; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class BrandVettingContext extends InstanceContext { /** * Initialize the BrandVettingContext * * @param Version $version Version that contains the resource * @param string $brandSid A2P BrandRegistration Sid * @param string $brandVettingSid SID for third-party vetting record */ public function __construct(Version $version, $brandSid, $brandVettingSid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Messaging/V1/BrandRegistration/BrandVettingPage.php 0000644 00000002522 15107452346 0016275 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\BrandRegistration; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class BrandVettingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Messaging/V1/UsecaseInstance.php 0000644 00000003256 15107452346 0012552 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property array[] $usecases */ class UsecaseInstance extends InstanceResource { /** * Initialize the UsecaseInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Messaging/V1/DomainConfigInstance.php 0000644 00000010345 15107452346 0013514 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $domainSid * @property string $configSid * @property string[] $messagingServiceSids * @property string $fallbackUrl * @property string $callbackUrl * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class DomainConfigInstance extends InstanceResource { /** * Initialize the DomainConfigInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $domainSid Unique string used to identify the domain that this * config should be associated with. */ public function __construct(Version $version, array $payload, string $domainSid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'domainSid' => Values::array_get($payload, 'domain_sid'), 'configSid' => Values::array_get($payload, 'config_sid'), 'messagingServiceSids' => Values::array_get($payload, 'messaging_service_sids'), 'fallbackUrl' => Values::array_get($payload, 'fallback_url'), 'callbackUrl' => Values::array_get($payload, 'callback_url'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $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; } /** * Update the DomainConfigInstance * * @param string[] $messagingServiceSids A list of messagingServiceSids (with * prefix MG) * @param array|Options $options Optional Arguments * @return DomainConfigInstance Updated DomainConfigInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $messagingServiceSids, array $options = []): DomainConfigInstance { return $this->proxy()->update($messagingServiceSids, $options); } /** * Fetch the DomainConfigInstance * * @return DomainConfigInstance Fetched DomainConfigInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DomainConfigInstance { 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.DomainConfigInstance ' . \implode(' ', $context) . ']'; } } Messaging/V1/BrandRegistrationInstance.php 0000644 00000012651 15107452346 0014602 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Rest\Messaging\V1\BrandRegistration\BrandVettingList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $customerProfileBundleSid * @property string $a2PProfileBundleSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $brandType * @property string $status * @property string $tcrId * @property string $failureReason * @property string $url * @property int $brandScore * @property string[] $brandFeedback * @property string $identityStatus * @property bool $russell3000 * @property bool $governmentEntity * @property string $taxExemptStatus * @property bool $skipAutomaticSecVet * @property bool $mock * @property array $links */ class BrandRegistrationInstance extends InstanceResource { protected $_brandVettings; /** * Initialize the BrandRegistrationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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'), '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 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) . ']'; } } Messaging/V1.php 0000644 00000011742 15107452346 0007474 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Messaging\V1\BrandRegistrationList; use Twilio\Rest\Messaging\V1\DeactivationsList; use Twilio\Rest\Messaging\V1\DomainCertsList; use Twilio\Rest\Messaging\V1\DomainConfigList; use Twilio\Rest\Messaging\V1\ExternalCampaignList; use Twilio\Rest\Messaging\V1\ServiceList; use Twilio\Rest\Messaging\V1\TollfreeVerificationList; use Twilio\Rest\Messaging\V1\UsecaseList; use Twilio\Version; /** * @property BrandRegistrationList $brandRegistrations * @property DeactivationsList $deactivations * @property DomainCertsList $domainCerts * @property DomainConfigList $domainConfig * @property ExternalCampaignList $externalCampaign * @property ServiceList $services * @property TollfreeVerificationList $tollfreeVerifications * @property UsecaseList $usecases * @method \Twilio\Rest\Messaging\V1\BrandRegistrationContext brandRegistrations(string $sid) * @method \Twilio\Rest\Messaging\V1\DomainCertsContext domainCerts(string $domainSid) * @method \Twilio\Rest\Messaging\V1\DomainConfigContext domainConfig(string $domainSid) * @method \Twilio\Rest\Messaging\V1\ServiceContext services(string $sid) * @method \Twilio\Rest\Messaging\V1\TollfreeVerificationContext tollfreeVerifications(string $sid) */ class V1 extends Version { protected $_brandRegistrations; protected $_deactivations; protected $_domainCerts; protected $_domainConfig; protected $_externalCampaign; protected $_services; protected $_tollfreeVerifications; protected $_usecases; /** * Construct the V1 version of Messaging * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->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 getExternalCampaign(): ExternalCampaignList { if (!$this->_externalCampaign) { $this->_externalCampaign = new ExternalCampaignList($this); } return $this->_externalCampaign; } 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]'; } } Sync/V1/Service/SyncMap/SyncMapItemPage.php 0000644 00000002437 15107452346 0014434 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncMap; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SyncMapItemPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Sync/V1/Service/SyncMap/SyncMapPermissionPage.php 0000644 00000002503 15107452346 0015660 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncMap; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SyncMapPermissionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Sync/V1/Service/SyncMap/SyncMapItemInstance.php 0000644 00000011573 15107452346 0015325 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncMap; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $key * @property string $accountSid * @property string $serviceSid * @property string $mapSid * @property string $url * @property string $revision * @property array $data * @property \DateTime $dateExpires * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $createdBy */ class SyncMapItemInstance extends InstanceResource { /** * Initialize the SyncMapItemInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Sync Service that the resource is * associated with * @param string $mapSid The SID of the Sync Map that contains the Map Item * @param string $key The key value of the Sync Map Item resource to fetch */ public function __construct(Version $version, array $payload, string $serviceSid, string $mapSid, string $key = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the SyncMapItemInstance * * @return SyncMapItemInstance Fetched SyncMapItemInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncMapItemInstance { return $this->proxy()->fetch(); } /** * 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); } /** * 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) . ']'; } } Sync/V1/Service/SyncMap/SyncMapPermissionContext.php 0000644 00000006726 15107452346 0016443 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncMap; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class SyncMapPermissionContext extends InstanceContext { /** * Initialize the SyncMapPermissionContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service with the Sync Map * Permission resource to fetch * @param string $mapSid The SID of the Sync Map with the Sync Map Permission * resource to fetch * @param string $identity The application-defined string that uniquely * identifies the User's Sync Map Permission resource * to fetch */ public function __construct(Version $version, $serviceSid, $mapSid, $identity) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'mapSid' => $mapSid, 'identity' => $identity, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Maps/' . \rawurlencode($mapSid) . '/Permissions/' . \rawurlencode($identity) . ''; } /** * Fetch the SyncMapPermissionInstance * * @return SyncMapPermissionInstance Fetched SyncMapPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncMapPermissionInstance { $payload = $this->version->fetch('GET', $this->uri); return new SyncMapPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['identity'] ); } /** * Delete the SyncMapPermissionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the SyncMapPermissionInstance * * @param bool $read Read access * @param bool $write Write access * @param bool $manage Manage access * @return SyncMapPermissionInstance Updated SyncMapPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $read, bool $write, bool $manage): SyncMapPermissionInstance { $data = Values::of([ 'Read' => Serialize::booleanToString($read), 'Write' => Serialize::booleanToString($write), 'Manage' => Serialize::booleanToString($manage), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SyncMapPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['identity'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncMapPermissionContext ' . \implode(' ', $context) . ']'; } } Sync/V1/Service/SyncMap/SyncMapItemContext.php 0000644 00000007004 15107452346 0015177 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncMap; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class SyncMapItemContext extends InstanceContext { /** * Initialize the SyncMapItemContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service with the Sync Map Item * resource to fetch * @param string $mapSid The SID of the Sync Map with the Sync Map Item * resource to fetch * @param string $key The key value of the Sync Map Item resource to fetch */ public function __construct(Version $version, $serviceSid, $mapSid, $key) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'mapSid' => $mapSid, 'key' => $key, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Maps/' . \rawurlencode($mapSid) . '/Items/' . \rawurlencode($key) . ''; } /** * Fetch the SyncMapItemInstance * * @return SyncMapItemInstance Fetched SyncMapItemInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncMapItemInstance { $payload = $this->version->fetch('GET', $this->uri); return new SyncMapItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['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(['If-Match' => $options['ifMatch'], ]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * 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(['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) . ']'; } } Sync/V1/Service/SyncMap/SyncMapItemList.php 0000644 00000015301 15107452346 0014465 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncMap; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class SyncMapItemList extends ListResource { /** * Construct the SyncMapItemList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service that the resource is * associated with * @param string $mapSid The SID of the Sync Map that contains the Map Item */ public function __construct(Version $version, string $serviceSid, string $mapSid) { parent::__construct($version); // Path Solution $this->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 * @param array $data A JSON string that represents an arbitrary, schema-less * object that the Map Item stores * @param array|Options $options Optional Arguments * @return SyncMapItemInstance 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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SyncMapItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'] ); } /** * Streams SyncMapItemInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of SyncMapItemInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 fetch */ 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]'; } } Sync/V1/Service/SyncMap/SyncMapPermissionList.php 0000644 00000012427 15107452346 0015725 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncMap; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class SyncMapPermissionList extends ListResource { /** * Construct the SyncMapPermissionList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service that the resource is * associated with * @param string $mapSid Sync Map SID */ public function __construct(Version $version, string $serviceSid, string $mapSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'mapSid' => $mapSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Maps/' . \rawurlencode($mapSid) . '/Permissions'; } /** * Streams SyncMapPermissionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 fetch */ 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]'; } } Sync/V1/Service/SyncMap/SyncMapItemOptions.php 0000644 00000027002 15107452346 0015206 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncMap; use Twilio\Options; use Twilio\Values; abstract class SyncMapItemOptions { /** * @param string $ifMatch The If-Match HTTP request header * @return DeleteSyncMapItemOptions Options builder */ public static function delete(string $ifMatch = Values::NONE): DeleteSyncMapItemOptions { return new DeleteSyncMapItemOptions($ifMatch); } /** * @param int $ttl An alias for item_ttl * @param int $itemTtl How long, in seconds, before the Map Item expires * @param int $collectionTtl How long, in seconds, before the Map Item's parent * Sync Map expires and is deleted * @return CreateSyncMapItemOptions Options builder */ public static function create(int $ttl = Values::NONE, int $itemTtl = Values::NONE, int $collectionTtl = Values::NONE): CreateSyncMapItemOptions { return new CreateSyncMapItemOptions($ttl, $itemTtl, $collectionTtl); } /** * @param string $order How to order the Map Items returned by their key value * @param string $from The index of the first Sync Map Item resource to read * @param string $bounds Whether to include the Map Item referenced by the from * parameter * @return ReadSyncMapItemOptions Options builder */ public static function read(string $order = Values::NONE, string $from = Values::NONE, string $bounds = Values::NONE): ReadSyncMapItemOptions { return new ReadSyncMapItemOptions($order, $from, $bounds); } /** * @param array $data A JSON string that represents an arbitrary, schema-less * object that the Map Item stores * @param int $ttl An alias for item_ttl * @param int $itemTtl How long, in seconds, before the Map Item expires * @param int $collectionTtl How long, in seconds, before the Map Item's parent * Sync Map expires and is deleted * @param string $ifMatch The If-Match HTTP request header * @return UpdateSyncMapItemOptions Options builder */ public static function update(array $data = Values::ARRAY_NONE, int $ttl = Values::NONE, int $itemTtl = Values::NONE, int $collectionTtl = Values::NONE, string $ifMatch = Values::NONE): UpdateSyncMapItemOptions { return new UpdateSyncMapItemOptions($data, $ttl, $itemTtl, $collectionTtl, $ifMatch); } } class DeleteSyncMapItemOptions extends Options { /** * @param string $ifMatch The If-Match HTTP request header */ 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 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.DeleteSyncMapItemOptions ' . $options . ']'; } } class CreateSyncMapItemOptions extends Options { /** * @param int $ttl An alias for item_ttl * @param int $itemTtl How long, in seconds, before the Map Item expires * @param int $collectionTtl How long, in seconds, before the Map Item's parent * Sync Map expires and is deleted */ public function __construct(int $ttl = Values::NONE, int $itemTtl = Values::NONE, int $collectionTtl = Values::NONE) { $this->options['ttl'] = $ttl; $this->options['itemTtl'] = $itemTtl; $this->options['collectionTtl'] = $collectionTtl; } /** * An alias for `item_ttl`. If both parameters are provided, this value is ignored. * * @param int $ttl An alias for item_ttl * @return $this Fluent Builder */ public function setTtl(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, before the Map Item expires * @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, before the Map Item's parent * Sync Map expires 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 ReadSyncMapItemOptions extends Options { /** * @param string $order How to order the Map Items returned by their key value * @param string $from The index of the first Sync Map Item resource to read * @param string $bounds Whether to include the Map Item referenced by the from * parameter */ public function __construct(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 * @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 index of the first Sync Map Item resource to read * @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 * @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 * @param int $ttl An alias for item_ttl * @param int $itemTtl How long, in seconds, before the Map Item expires * @param int $collectionTtl How long, in seconds, before the Map Item's parent * Sync Map expires and is deleted * @param string $ifMatch The If-Match HTTP request header */ public function __construct(array $data = Values::ARRAY_NONE, int $ttl = Values::NONE, int $itemTtl = Values::NONE, int $collectionTtl = Values::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 * @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 * @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, before the Map Item expires * @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, before the Map Item's parent * Sync Map expires and is deleted * @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 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.UpdateSyncMapItemOptions ' . $options . ']'; } } Sync/V1/Service/SyncMap/SyncMapPermissionInstance.php 0000644 00000011213 15107452346 0016546 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncMap; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $serviceSid * @property string $mapSid * @property string $identity * @property bool $read * @property bool $write * @property bool $manage * @property string $url */ class SyncMapPermissionInstance extends InstanceResource { /** * Initialize the SyncMapPermissionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Sync Service that the resource is * associated with * @param string $mapSid Sync Map SID * @param string $identity The application-defined string that uniquely * identifies the User's Sync Map Permission resource * to fetch */ public function __construct(Version $version, array $payload, string $serviceSid, string $mapSid, string $identity = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the SyncMapPermissionInstance * * @return SyncMapPermissionInstance Fetched SyncMapPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncMapPermissionInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Update the SyncMapPermissionInstance * * @param bool $read Read access * @param bool $write Write access * @param bool $manage Manage access * @return SyncMapPermissionInstance Updated SyncMapPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(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) . ']'; } } Sync/V1/Service/DocumentOptions.php 0000644 00000013711 15107452346 0013223 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Options; use Twilio\Values; abstract class DocumentOptions { /** * @param string $uniqueName An application-defined string that uniquely * identifies the Sync Document * @param array $data A JSON string that represents an arbitrary, schema-less * object that the Sync Document stores * @param int $ttl How long, in seconds, before the Sync Document expires and * is deleted * @return CreateDocumentOptions Options builder */ public static function create(string $uniqueName = Values::NONE, array $data = Values::ARRAY_NONE, int $ttl = Values::NONE): CreateDocumentOptions { return new CreateDocumentOptions($uniqueName, $data, $ttl); } /** * @param array $data A JSON string that represents an arbitrary, schema-less * object that the Sync Document stores * @param int $ttl How long, in seconds, before the Document resource expires * and is deleted * @param string $ifMatch The If-Match HTTP request header * @return UpdateDocumentOptions Options builder */ public static function update(array $data = Values::ARRAY_NONE, int $ttl = Values::NONE, string $ifMatch = Values::NONE): UpdateDocumentOptions { return new UpdateDocumentOptions($data, $ttl, $ifMatch); } } class CreateDocumentOptions extends Options { /** * @param string $uniqueName An application-defined string that uniquely * identifies the Sync Document * @param array $data A JSON string that represents an arbitrary, schema-less * object that the Sync Document stores * @param int $ttl How long, in seconds, before the Sync Document expires and * is deleted */ public function __construct(string $uniqueName = Values::NONE, array $data = Values::ARRAY_NONE, int $ttl = Values::NONE) { $this->options['uniqueName'] = $uniqueName; $this->options['data'] = $data; $this->options['ttl'] = $ttl; } /** * An application-defined string that uniquely identifies the Sync Document * * @param string $uniqueName An application-defined string that uniquely * identifies the Sync Document * @return $this Fluent Builder */ public function setUniqueName(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 * @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, before the Sync Document expires and * is deleted * @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 * @param int $ttl How long, in seconds, before the Document resource expires * and is deleted * @param string $ifMatch The If-Match HTTP request header */ public function __construct(array $data = Values::ARRAY_NONE, int $ttl = Values::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 * @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, before the Document resource expires * and is deleted * @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 . ']'; } } Sync/V1/Service/DocumentContext.php 0000644 00000011260 15107452346 0013211 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Sync\V1\Service\Document\DocumentPermissionList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property DocumentPermissionList $documentPermissions * @method \Twilio\Rest\Sync\V1\Service\Document\DocumentPermissionContext documentPermissions(string $identity) */ class DocumentContext extends InstanceContext { protected $_documentPermissions; /** * Initialize the DocumentContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service with the Document * resource to fetch * @param string $sid The SID of the Document resource to fetch */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Documents/' . \rawurlencode($sid) . ''; } /** * Fetch the DocumentInstance * * @return DocumentInstance Fetched DocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DocumentInstance { $payload = $this->version->fetch('GET', $this->uri); return new DocumentInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Delete the DocumentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the DocumentInstance * * @param array|Options $options Optional Arguments * @return DocumentInstance Updated DocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): DocumentInstance { $options = new Values($options); $data = Values::of(['Data' => Serialize::jsonObject($options['data']), 'Ttl' => $options['ttl'], ]); $headers = Values::of(['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) . ']'; } } Sync/V1/Service/SyncMapContext.php 0000644 00000012206 15107452346 0013006 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapItemList; use Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapPermissionList; use Twilio\Values; use Twilio\Version; /** * @property SyncMapItemList $syncMapItems * @property SyncMapPermissionList $syncMapPermissions * @method \Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapItemContext syncMapItems(string $key) * @method \Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapPermissionContext syncMapPermissions(string $identity) */ class SyncMapContext extends InstanceContext { protected $_syncMapItems; protected $_syncMapPermissions; /** * Initialize the SyncMapContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service with the Sync Map * resource to fetch * @param string $sid The SID of the Sync Map resource to fetch */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Maps/' . \rawurlencode($sid) . ''; } /** * Fetch the SyncMapInstance * * @return SyncMapInstance Fetched SyncMapInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncMapInstance { $payload = $this->version->fetch('GET', $this->uri); return new SyncMapInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Delete the SyncMapInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the SyncMapInstance * * @param array|Options $options Optional Arguments * @return SyncMapInstance Updated SyncMapInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SyncMapInstance { $options = new Values($options); $data = Values::of(['Ttl' => $options['ttl'], 'CollectionTtl' => $options['collectionTtl'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } Sync/V1/Service/DocumentList.php 0000644 00000013045 15107452346 0012503 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class DocumentList extends ListResource { /** * Construct the DocumentList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service that the resource is * associated with */ public function __construct(Version $version, string $serviceSid) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new DocumentInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams DocumentInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 fetch */ 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]'; } } Sync/V1/Service/Document/DocumentPermissionList.php 0000644 00000012536 15107452346 0016336 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\Document; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class DocumentPermissionList extends ListResource { /** * Construct the DocumentPermissionList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service that the resource is * associated with * @param string $documentSid The Sync Document SID */ public function __construct(Version $version, string $serviceSid, string $documentSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'documentSid' => $documentSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Documents/' . \rawurlencode($documentSid) . '/Permissions'; } /** * Streams DocumentPermissionInstance records from the API as a generator * stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 fetch */ 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]'; } } Sync/V1/Service/Document/DocumentPermissionContext.php 0000644 00000007104 15107452346 0017042 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\Document; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class DocumentPermissionContext extends InstanceContext { /** * Initialize the DocumentPermissionContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service with the Document * Permission resource to fetch * @param string $documentSid The SID of the Sync Document with the Document * Permission resource to fetch * @param string $identity The application-defined string that uniquely * identifies the User's Document Permission resource * to fetch */ public function __construct(Version $version, $serviceSid, $documentSid, $identity) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'documentSid' => $documentSid, 'identity' => $identity, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Documents/' . \rawurlencode($documentSid) . '/Permissions/' . \rawurlencode($identity) . ''; } /** * Fetch the DocumentPermissionInstance * * @return DocumentPermissionInstance Fetched DocumentPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DocumentPermissionInstance { $payload = $this->version->fetch('GET', $this->uri); return new DocumentPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['documentSid'], $this->solution['identity'] ); } /** * Delete the DocumentPermissionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the DocumentPermissionInstance * * @param bool $read Read access * @param bool $write Write access * @param bool $manage Manage access * @return DocumentPermissionInstance Updated DocumentPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $read, bool $write, bool $manage): DocumentPermissionInstance { $data = Values::of([ 'Read' => Serialize::booleanToString($read), 'Write' => Serialize::booleanToString($write), 'Manage' => Serialize::booleanToString($manage), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new DocumentPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['documentSid'], $this->solution['identity'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.DocumentPermissionContext ' . \implode(' ', $context) . ']'; } } Sync/V1/Service/Document/DocumentPermissionPage.php 0000644 00000002520 15107452346 0016267 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\Document; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class DocumentPermissionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Sync/V1/Service/Document/DocumentPermissionInstance.php 0000644 00000011315 15107452346 0017161 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\Document; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $serviceSid * @property string $documentSid * @property string $identity * @property bool $read * @property bool $write * @property bool $manage * @property string $url */ class DocumentPermissionInstance extends InstanceResource { /** * Initialize the DocumentPermissionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Sync Service that the resource is * associated with * @param string $documentSid The Sync Document SID * @param string $identity The application-defined string that uniquely * identifies the User's Document Permission resource * to fetch */ public function __construct(Version $version, array $payload, string $serviceSid, string $documentSid, string $identity = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the DocumentPermissionInstance * * @return DocumentPermissionInstance Fetched DocumentPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DocumentPermissionInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Update the DocumentPermissionInstance * * @param bool $read Read access * @param bool $write Write access * @param bool $manage Manage access * @return DocumentPermissionInstance Updated DocumentPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(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) . ']'; } } Sync/V1/Service/SyncStream/StreamMessageInstance.php 0000644 00000003747 15107452346 0016416 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncStream; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property array $data */ class StreamMessageInstance extends InstanceResource { /** * Initialize the StreamMessageInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Sync Service that the resource is * associated with * @param string $streamSid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $serviceSid, string $streamSid) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Sync/V1/Service/SyncStream/StreamMessagePage.php 0000644 00000002464 15107452346 0015521 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncStream; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class StreamMessagePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Sync/V1/Service/SyncStream/StreamMessageList.php 0000644 00000003742 15107452346 0015560 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncStream; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class StreamMessageList extends ListResource { /** * Construct the StreamMessageList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service that the resource is * associated with * @param string $streamSid The unique string that identifies the resource */ public function __construct(Version $version, string $serviceSid, string $streamSid) { parent::__construct($version); // Path Solution $this->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 * @return StreamMessageInstance Created StreamMessageInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $data): StreamMessageInstance { $data = Values::of(['Data' => Serialize::jsonObject($data), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new StreamMessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['streamSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync.V1.StreamMessageList]'; } } Sync/V1/Service/SyncListPage.php 0000644 00000002250 15107452346 0012432 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SyncListPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Sync/V1/Service/SyncListOptions.php 0000644 00000012157 15107452346 0013220 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Options; use Twilio\Values; abstract class SyncListOptions { /** * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param int $ttl Alias for collection_ttl * @param int $collectionTtl How long, in seconds, before the Sync List expires * and is deleted * @return CreateSyncListOptions Options builder */ public static function create(string $uniqueName = Values::NONE, int $ttl = Values::NONE, int $collectionTtl = Values::NONE): CreateSyncListOptions { return new CreateSyncListOptions($uniqueName, $ttl, $collectionTtl); } /** * @param int $ttl An alias for collection_ttl * @param int $collectionTtl How long, in seconds, before the Sync List expires * and is deleted * @return UpdateSyncListOptions Options builder */ public static function update(int $ttl = Values::NONE, int $collectionTtl = Values::NONE): UpdateSyncListOptions { return new UpdateSyncListOptions($ttl, $collectionTtl); } } class CreateSyncListOptions extends Options { /** * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param int $ttl Alias for collection_ttl * @param int $collectionTtl How long, in seconds, before the Sync List expires * and is deleted */ public function __construct(string $uniqueName = Values::NONE, int $ttl = Values::NONE, int $collectionTtl = Values::NONE) { $this->options['uniqueName'] = $uniqueName; $this->options['ttl'] = $ttl; $this->options['collectionTtl'] = $collectionTtl; } /** * An application-defined string that uniquely identifies the resource. This value must be unique within its Service and it can be up to 320 characters long. The `unique_name` value can be used as an alternative to the `sid` in the URL path to address the resource. * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return $this Fluent Builder */ public function setUniqueName(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 * @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, before the Sync List expires * 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 * @param int $collectionTtl How long, in seconds, before the Sync List expires * and is deleted */ public function __construct(int $ttl = Values::NONE, int $collectionTtl = Values::NONE) { $this->options['ttl'] = $ttl; $this->options['collectionTtl'] = $collectionTtl; } /** * An alias for `collection_ttl`. If both are provided, this value is ignored. * * @param int $ttl An alias for collection_ttl * @return $this Fluent Builder */ public function setTtl(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, before the Sync List expires * 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 . ']'; } } Sync/V1/Service/SyncMapInstance.php 0000644 00000012050 15107452346 0013123 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapItemList; use Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapPermissionList; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $uniqueName * @property string $accountSid * @property string $serviceSid * @property string $url * @property array $links * @property string $revision * @property \DateTime $dateExpires * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $createdBy */ class SyncMapInstance extends InstanceResource { protected $_syncMapItems; protected $_syncMapPermissions; /** * Initialize the SyncMapInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Sync Service that the resource is * associated with * @param string $sid The SID of the Sync Map resource to fetch */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the SyncMapInstance * * @return SyncMapInstance Fetched SyncMapInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncMapInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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) . ']'; } } Sync/V1/Service/SyncList/SyncListPermissionContext.php 0000644 00000006762 15107452346 0017037 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncList; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class SyncListPermissionContext extends InstanceContext { /** * Initialize the SyncListPermissionContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service with the Sync List * Permission resource to fetch * @param string $listSid The SID of the Sync List with the Sync List * Permission resource to fetch * @param string $identity The application-defined string that uniquely * identifies the User's Sync List Permission resource * to fetch */ public function __construct(Version $version, $serviceSid, $listSid, $identity) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'listSid' => $listSid, 'identity' => $identity, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Lists/' . \rawurlencode($listSid) . '/Permissions/' . \rawurlencode($identity) . ''; } /** * Fetch the SyncListPermissionInstance * * @return SyncListPermissionInstance Fetched SyncListPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncListPermissionInstance { $payload = $this->version->fetch('GET', $this->uri); return new SyncListPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid'], $this->solution['identity'] ); } /** * Delete the SyncListPermissionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the SyncListPermissionInstance * * @param bool $read Read access * @param bool $write Write access * @param bool $manage Manage access * @return SyncListPermissionInstance Updated SyncListPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $read, bool $write, bool $manage): SyncListPermissionInstance { $data = Values::of([ 'Read' => Serialize::booleanToString($read), 'Write' => Serialize::booleanToString($write), 'Manage' => Serialize::booleanToString($manage), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SyncListPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid'], $this->solution['identity'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncListPermissionContext ' . \implode(' ', $context) . ']'; } } Sync/V1/Service/SyncList/SyncListPermissionPage.php 0000644 00000002514 15107452346 0016256 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncList; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SyncListPermissionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Sync/V1/Service/SyncList/SyncListPermissionList.php 0000644 00000012604 15107452346 0016316 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncList; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class SyncListPermissionList extends ListResource { /** * Construct the SyncListPermissionList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service that the resource is * associated with * @param string $listSid The SID of the Sync List to which the Permission * applies */ public function __construct(Version $version, string $serviceSid, string $listSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'listSid' => $listSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Lists/' . \rawurlencode($listSid) . '/Permissions'; } /** * Streams SyncListPermissionInstance records from the API as a generator * stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 fetch */ 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]'; } } Sync/V1/Service/SyncList/SyncListItemContext.php 0000644 00000007047 15107452346 0015602 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncList; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class SyncListItemContext extends InstanceContext { /** * Initialize the SyncListItemContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service with the Sync List * Item resource to fetch * @param string $listSid The SID of the Sync List with the Sync List Item * resource to fetch * @param int $index The index of the Sync List Item resource to fetch */ public function __construct(Version $version, $serviceSid, $listSid, $index) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'listSid' => $listSid, 'index' => $index, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Lists/' . \rawurlencode($listSid) . '/Items/' . \rawurlencode($index) . ''; } /** * Fetch the SyncListItemInstance * * @return SyncListItemInstance Fetched SyncListItemInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncListItemInstance { $payload = $this->version->fetch('GET', $this->uri); return new SyncListItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid'], $this->solution['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(['If-Match' => $options['ifMatch'], ]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * 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(['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) . ']'; } } Sync/V1/Service/SyncList/SyncListItemOptions.php 0000644 00000026502 15107452346 0015606 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncList; use Twilio\Options; use Twilio\Values; abstract class SyncListItemOptions { /** * @param string $ifMatch The If-Match HTTP request header * @return DeleteSyncListItemOptions Options builder */ public static function delete(string $ifMatch = Values::NONE): DeleteSyncListItemOptions { return new DeleteSyncListItemOptions($ifMatch); } /** * @param int $ttl An alias for item_ttl * @param int $itemTtl How long, in seconds, before the List Item expires * @param int $collectionTtl How long, in seconds, before the List Item's * parent Sync List expires * @return CreateSyncListItemOptions Options builder */ public static function create(int $ttl = Values::NONE, int $itemTtl = Values::NONE, int $collectionTtl = Values::NONE): CreateSyncListItemOptions { return new CreateSyncListItemOptions($ttl, $itemTtl, $collectionTtl); } /** * @param string $order The order to return the List Items * @param string $from The index of the first Sync List Item resource to read * @param string $bounds Whether to include the List Item referenced by the * from parameter * @return ReadSyncListItemOptions Options builder */ public static function read(string $order = Values::NONE, string $from = Values::NONE, string $bounds = Values::NONE): ReadSyncListItemOptions { return new ReadSyncListItemOptions($order, $from, $bounds); } /** * @param array $data A JSON string that represents an arbitrary, schema-less * object that the List Item stores * @param int $ttl An alias for item_ttl * @param int $itemTtl How long, in seconds, before the List Item expires * @param int $collectionTtl How long, in seconds, before the List Item's * parent Sync List expires * @param string $ifMatch The If-Match HTTP request header * @return UpdateSyncListItemOptions Options builder */ public static function update(array $data = Values::ARRAY_NONE, int $ttl = Values::NONE, int $itemTtl = Values::NONE, int $collectionTtl = Values::NONE, string $ifMatch = Values::NONE): UpdateSyncListItemOptions { return new UpdateSyncListItemOptions($data, $ttl, $itemTtl, $collectionTtl, $ifMatch); } } class DeleteSyncListItemOptions extends Options { /** * @param string $ifMatch The If-Match HTTP request header */ 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 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.DeleteSyncListItemOptions ' . $options . ']'; } } class CreateSyncListItemOptions extends Options { /** * @param int $ttl An alias for item_ttl * @param int $itemTtl How long, in seconds, before the List Item expires * @param int $collectionTtl How long, in seconds, before the List Item's * parent Sync List expires */ public function __construct(int $ttl = Values::NONE, int $itemTtl = Values::NONE, int $collectionTtl = Values::NONE) { $this->options['ttl'] = $ttl; $this->options['itemTtl'] = $itemTtl; $this->options['collectionTtl'] = $collectionTtl; } /** * An alias for `item_ttl`. If both parameters are provided, this value is ignored. * * @param int $ttl An alias for item_ttl * @return $this Fluent Builder */ public function setTtl(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, before the List Item expires * @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, before the List Item's * parent Sync List expires * @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 ReadSyncListItemOptions extends Options { /** * @param string $order The order to return the List Items * @param string $from The index of the first Sync List Item resource to read * @param string $bounds Whether to include the List Item referenced by the * from parameter */ public function __construct(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 The order to return the List Items * @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 * @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 * @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 * @param int $ttl An alias for item_ttl * @param int $itemTtl How long, in seconds, before the List Item expires * @param int $collectionTtl How long, in seconds, before the List Item's * parent Sync List expires * @param string $ifMatch The If-Match HTTP request header */ public function __construct(array $data = Values::ARRAY_NONE, int $ttl = Values::NONE, int $itemTtl = Values::NONE, int $collectionTtl = Values::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 * @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 * @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, before the List Item expires * @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, before the List Item's * parent Sync List expires * @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 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.UpdateSyncListItemOptions ' . $options . ']'; } } Sync/V1/Service/SyncList/SyncListItemList.php 0000644 00000015162 15107452346 0015066 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncList; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class SyncListItemList extends ListResource { /** * Construct the SyncListItemList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service that the resource is * associated with * @param string $listSid The SID of the Sync List that contains the List Item */ public function __construct(Version $version, string $serviceSid, string $listSid) { parent::__construct($version); // Path Solution $this->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 * @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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SyncListItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid'] ); } /** * Streams SyncListItemInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of SyncListItemInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 fetch */ 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]'; } } Sync/V1/Service/SyncList/SyncListItemPage.php 0000644 00000002450 15107452346 0015023 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncList; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SyncListItemPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Sync/V1/Service/SyncList/SyncListPermissionInstance.php 0000644 00000011357 15107452346 0017153 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncList; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $serviceSid * @property string $listSid * @property string $identity * @property bool $read * @property bool $write * @property bool $manage * @property string $url */ class SyncListPermissionInstance extends InstanceResource { /** * Initialize the SyncListPermissionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Sync Service that the resource is * associated with * @param string $listSid The SID of the Sync List to which the Permission * applies * @param string $identity The application-defined string that uniquely * identifies the User's Sync List Permission resource * to fetch */ public function __construct(Version $version, array $payload, string $serviceSid, string $listSid, string $identity = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the SyncListPermissionInstance * * @return SyncListPermissionInstance Fetched SyncListPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncListPermissionInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Update the SyncListPermissionInstance * * @param bool $read Read access * @param bool $write Write access * @param bool $manage Manage access * @return SyncListPermissionInstance Updated SyncListPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(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) . ']'; } } Sync/V1/Service/SyncList/SyncListItemInstance.php 0000644 00000011634 15107452346 0015717 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncList; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property int $index * @property string $accountSid * @property string $serviceSid * @property string $listSid * @property string $url * @property string $revision * @property array $data * @property \DateTime $dateExpires * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $createdBy */ class SyncListItemInstance extends InstanceResource { /** * Initialize the SyncListItemInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Sync Service that the resource is * associated with * @param string $listSid The SID of the Sync List that contains the List Item * @param int $index The index of the Sync List Item resource to fetch */ public function __construct(Version $version, array $payload, string $serviceSid, string $listSid, int $index = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the SyncListItemInstance * * @return SyncListItemInstance Fetched SyncListItemInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncListItemInstance { return $this->proxy()->fetch(); } /** * 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); } /** * 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) . ']'; } } Sync/V1/Service/SyncMapList.php 0000644 00000012755 15107452346 0012306 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class SyncMapList extends ListResource { /** * Construct the SyncMapList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service that the resource is * associated with */ public function __construct(Version $version, string $serviceSid) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SyncMapInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams SyncMapInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 fetch */ 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]'; } } Sync/V1/Service/DocumentInstance.php 0000644 00000011635 15107452346 0013337 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Sync\V1\Service\Document\DocumentPermissionList; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $uniqueName * @property string $accountSid * @property string $serviceSid * @property string $url * @property array $links * @property string $revision * @property array $data * @property \DateTime $dateExpires * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $createdBy */ class DocumentInstance extends InstanceResource { protected $_documentPermissions; /** * Initialize the DocumentInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Sync Service that the resource is * associated with * @param string $sid The SID of the Document resource to fetch */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the DocumentInstance * * @return DocumentInstance Fetched DocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DocumentInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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) . ']'; } } Sync/V1/Service/SyncStreamOptions.php 0000644 00000007545 15107452346 0013545 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Options; use Twilio\Values; abstract class SyncStreamOptions { /** * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param int $ttl How long, in seconds, before the Stream expires and is * deleted * @return CreateSyncStreamOptions Options builder */ public static function create(string $uniqueName = Values::NONE, int $ttl = Values::NONE): CreateSyncStreamOptions { return new CreateSyncStreamOptions($uniqueName, $ttl); } /** * @param int $ttl How long, in seconds, before the Stream expires and is * deleted * @return UpdateSyncStreamOptions Options builder */ public static function update(int $ttl = Values::NONE): UpdateSyncStreamOptions { return new UpdateSyncStreamOptions($ttl); } } class CreateSyncStreamOptions extends Options { /** * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param int $ttl How long, in seconds, before the Stream expires and is * deleted */ public function __construct(string $uniqueName = Values::NONE, int $ttl = Values::NONE) { $this->options['uniqueName'] = $uniqueName; $this->options['ttl'] = $ttl; } /** * An application-defined string that uniquely identifies the resource. This value must be unique within its Service and it can be up to 320 characters long. The `unique_name` value can be used as an alternative to the `sid` in the URL path to address the resource. * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return $this Fluent Builder */ public function setUniqueName(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, before the Stream expires and is * deleted * @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, before the Stream expires and is * deleted */ public function __construct(int $ttl = Values::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, before the Stream expires and is * deleted * @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 . ']'; } } Sync/V1/Service/SyncStreamList.php 0000644 00000012733 15107452346 0013020 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class SyncStreamList extends ListResource { /** * Construct the SyncStreamList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service that the resource is * associated with */ public function __construct(Version $version, string $serviceSid) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SyncStreamInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams SyncStreamInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 fetch */ 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]'; } } Sync/V1/Service/SyncStreamPage.php 0000644 00000002264 15107452346 0012757 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SyncStreamPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Sync/V1/Service/DocumentPage.php 0000644 00000002250 15107452346 0012440 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class DocumentPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Sync/V1/Service/SyncListInstance.php 0000644 00000012107 15107452346 0013324 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Sync\V1\Service\SyncList\SyncListItemList; use Twilio\Rest\Sync\V1\Service\SyncList\SyncListPermissionList; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $uniqueName * @property string $accountSid * @property string $serviceSid * @property string $url * @property array $links * @property string $revision * @property \DateTime $dateExpires * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $createdBy */ class SyncListInstance extends InstanceResource { protected $_syncListItems; protected $_syncListPermissions; /** * Initialize the SyncListInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Sync Service that the resource is * associated with * @param string $sid The SID of the Sync List resource to fetch */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the SyncListInstance * * @return SyncListInstance Fetched SyncListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncListInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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 syncListItems */ protected function getSyncListItems(): SyncListItemList { return $this->proxy()->syncListItems; } /** * Access the syncListPermissions */ protected function getSyncListPermissions(): SyncListPermissionList { return $this->proxy()->syncListPermissions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Sync/V1/Service/SyncStreamInstance.php 0000644 00000011352 15107452346 0013645 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Sync\V1\Service\SyncStream\StreamMessageList; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $uniqueName * @property string $accountSid * @property string $serviceSid * @property string $url * @property array $links * @property \DateTime $dateExpires * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $createdBy */ class SyncStreamInstance extends InstanceResource { protected $_streamMessages; /** * Initialize the SyncStreamInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Sync Service that the resource is * associated with * @param string $sid The SID of the Stream resource to fetch */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the SyncStreamInstance * * @return SyncStreamInstance Fetched SyncStreamInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncStreamInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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) . ']'; } } Sync/V1/Service/SyncListList.php 0000644 00000013007 15107452346 0012473 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class SyncListList extends ListResource { /** * Construct the SyncListList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service that the resource is * associated with */ public function __construct(Version $version, string $serviceSid) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SyncListInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams SyncListInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 fetch */ 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]'; } } Sync/V1/Service/SyncMapPage.php 0000644 00000002242 15107452346 0012235 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SyncMapPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Sync/V1/Service/SyncListContext.php 0000644 00000012264 15107452346 0013210 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Sync\V1\Service\SyncList\SyncListItemList; use Twilio\Rest\Sync\V1\Service\SyncList\SyncListPermissionList; use Twilio\Values; use Twilio\Version; /** * @property SyncListItemList $syncListItems * @property SyncListPermissionList $syncListPermissions * @method \Twilio\Rest\Sync\V1\Service\SyncList\SyncListItemContext syncListItems(int $index) * @method \Twilio\Rest\Sync\V1\Service\SyncList\SyncListPermissionContext syncListPermissions(string $identity) */ class SyncListContext extends InstanceContext { protected $_syncListItems; protected $_syncListPermissions; /** * Initialize the SyncListContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service with the Sync List * resource to fetch * @param string $sid The SID of the Sync List resource to fetch */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Lists/' . \rawurlencode($sid) . ''; } /** * Fetch the SyncListInstance * * @return SyncListInstance Fetched SyncListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncListInstance { $payload = $this->version->fetch('GET', $this->uri); return new SyncListInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Delete the SyncListInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the SyncListInstance * * @param array|Options $options Optional Arguments * @return SyncListInstance Updated SyncListInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SyncListInstance { $options = new Values($options); $data = Values::of(['Ttl' => $options['ttl'], 'CollectionTtl' => $options['collectionTtl'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SyncListInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * 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; } /** * 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; } /** * 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) . ']'; } } Sync/V1/Service/SyncMapOptions.php 0000644 00000012025 15107452346 0013014 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Options; use Twilio\Values; abstract class SyncMapOptions { /** * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param int $ttl An alias for collection_ttl * @param int $collectionTtl How long, in seconds, before the Sync Map expires * and is deleted * @return CreateSyncMapOptions Options builder */ public static function create(string $uniqueName = Values::NONE, int $ttl = Values::NONE, int $collectionTtl = Values::NONE): CreateSyncMapOptions { return new CreateSyncMapOptions($uniqueName, $ttl, $collectionTtl); } /** * @param int $ttl An alias for collection_ttl * @param int $collectionTtl How long, in seconds, before the Sync Map expires * and is deleted * @return UpdateSyncMapOptions Options builder */ public static function update(int $ttl = Values::NONE, int $collectionTtl = Values::NONE): UpdateSyncMapOptions { return new UpdateSyncMapOptions($ttl, $collectionTtl); } } class CreateSyncMapOptions extends Options { /** * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param int $ttl An alias for collection_ttl * @param int $collectionTtl How long, in seconds, before the Sync Map expires * and is deleted */ public function __construct(string $uniqueName = Values::NONE, int $ttl = Values::NONE, int $collectionTtl = Values::NONE) { $this->options['uniqueName'] = $uniqueName; $this->options['ttl'] = $ttl; $this->options['collectionTtl'] = $collectionTtl; } /** * An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return $this Fluent Builder */ public function setUniqueName(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 * @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, before the Sync Map expires * 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 * @param int $collectionTtl How long, in seconds, before the Sync Map expires * and is deleted */ public function __construct(int $ttl = Values::NONE, int $collectionTtl = Values::NONE) { $this->options['ttl'] = $ttl; $this->options['collectionTtl'] = $collectionTtl; } /** * An alias for `collection_ttl`. If both parameters are provided, this value is ignored. * * @param int $ttl An alias for collection_ttl * @return $this Fluent Builder */ public function setTtl(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, before the Sync Map expires * 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 . ']'; } } Sync/V1/Service/SyncStreamContext.php 0000644 00000010614 15107452346 0013525 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Sync\V1\Service\SyncStream\StreamMessageList; use Twilio\Values; use Twilio\Version; /** * @property StreamMessageList $streamMessages */ class SyncStreamContext extends InstanceContext { protected $_streamMessages; /** * Initialize the SyncStreamContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service with the Sync Stream * resource to fetch * @param string $sid The SID of the Stream resource to fetch */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Streams/' . \rawurlencode($sid) . ''; } /** * Fetch the SyncStreamInstance * * @return SyncStreamInstance Fetched SyncStreamInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncStreamInstance { $payload = $this->version->fetch('GET', $this->uri); return new SyncStreamInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Delete the SyncStreamInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the SyncStreamInstance * * @param array|Options $options Optional Arguments * @return SyncStreamInstance Updated SyncStreamInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SyncStreamInstance { $options = new Values($options); $data = Values::of(['Ttl' => $options['ttl'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } Sync/V1/ServiceInstance.php 0000644 00000013142 15107452346 0011554 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Sync\V1\Service\DocumentList; use Twilio\Rest\Sync\V1\Service\SyncListList; use Twilio\Rest\Sync\V1\Service\SyncMapList; use Twilio\Rest\Sync\V1\Service\SyncStreamList; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $uniqueName * @property string $accountSid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property string $webhookUrl * @property bool $webhooksFromRestEnabled * @property bool $reachabilityWebhooksEnabled * @property bool $aclEnabled * @property bool $reachabilityDebouncingEnabled * @property int $reachabilityDebouncingWindow * @property array $links */ class ServiceInstance extends InstanceResource { protected $_documents; protected $_syncLists; protected $_syncMaps; protected $_syncStreams; /** * Initialize the ServiceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the Service resource to fetch */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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 documents */ protected function getDocuments(): DocumentList { return $this->proxy()->documents; } /** * Access the syncLists */ protected function getSyncLists(): SyncListList { return $this->proxy()->syncLists; } /** * Access the syncMaps */ protected function getSyncMaps(): SyncMapList { return $this->proxy()->syncMaps; } /** * Access the syncStreams */ protected function getSyncStreams(): SyncStreamList { return $this->proxy()->syncStreams; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Sync/V1/ServiceList.php 0000644 00000013262 15107452346 0010726 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ServiceList extends ListResource { /** * Construct the ServiceList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ServiceInstance($this->version, $payload); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 fetch */ 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]'; } } Sync/V1/ServiceContext.php 0000644 00000013544 15107452346 0011442 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Sync\V1\Service\DocumentList; use Twilio\Rest\Sync\V1\Service\SyncListList; use Twilio\Rest\Sync\V1\Service\SyncMapList; use Twilio\Rest\Sync\V1\Service\SyncStreamList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property DocumentList $documents * @property SyncListList $syncLists * @property SyncMapList $syncMaps * @property SyncStreamList $syncStreams * @method \Twilio\Rest\Sync\V1\Service\DocumentContext documents(string $sid) * @method \Twilio\Rest\Sync\V1\Service\SyncListContext syncLists(string $sid) * @method \Twilio\Rest\Sync\V1\Service\SyncMapContext syncMaps(string $sid) * @method \Twilio\Rest\Sync\V1\Service\SyncStreamContext syncStreams(string $sid) */ class ServiceContext extends InstanceContext { protected $_documents; protected $_syncLists; protected $_syncMaps; protected $_syncStreams; /** * Initialize the ServiceContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the Service resource to fetch */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($sid) . ''; } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { $payload = $this->version->fetch('GET', $this->uri); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(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']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Access the documents */ protected function getDocuments(): DocumentList { if (!$this->_documents) { $this->_documents = new DocumentList($this->version, $this->solution['sid']); } return $this->_documents; } /** * 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 syncStreams */ protected function getSyncStreams(): SyncStreamList { if (!$this->_syncStreams) { $this->_syncStreams = new SyncStreamList($this->version, $this->solution['sid']); } return $this->_syncStreams; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return 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) . ']'; } } Sync/V1/ServiceOptions.php 0000644 00000041765 15107452346 0011457 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1; use Twilio\Options; use Twilio\Values; abstract class ServiceOptions { /** * @param string $friendlyName A string that you assign to describe the resource * @param string $webhookUrl The URL we should call when Sync objects are * manipulated * @param bool $reachabilityWebhooksEnabled Whether the service instance should * call webhook_url when client * endpoints connect to Sync * @param bool $aclEnabled Whether token identities in the Service must be * granted access to Sync objects by using the * Permissions resource * @param bool $reachabilityDebouncingEnabled Whether every * endpoint_disconnected event * occurs after a configurable delay * @param int $reachabilityDebouncingWindow The reachability event delay in * milliseconds * @param bool $webhooksFromRestEnabled Whether the Service instance should * call webhook_url when the REST API is * used to update Sync objects * @return CreateServiceOptions Options builder */ public static function create(string $friendlyName = Values::NONE, string $webhookUrl = Values::NONE, bool $reachabilityWebhooksEnabled = Values::NONE, bool $aclEnabled = Values::NONE, bool $reachabilityDebouncingEnabled = Values::NONE, int $reachabilityDebouncingWindow = Values::NONE, bool $webhooksFromRestEnabled = Values::NONE): CreateServiceOptions { return new CreateServiceOptions($friendlyName, $webhookUrl, $reachabilityWebhooksEnabled, $aclEnabled, $reachabilityDebouncingEnabled, $reachabilityDebouncingWindow, $webhooksFromRestEnabled); } /** * @param string $webhookUrl The URL we should call when Sync objects are * manipulated * @param string $friendlyName A string that you assign to describe the resource * @param bool $reachabilityWebhooksEnabled Whether the service instance should * call webhook_url when client * endpoints connect to Sync * @param bool $aclEnabled Whether token identities in the Service must be * granted access to Sync objects by using the * Permissions resource * @param bool $reachabilityDebouncingEnabled Whether every * endpoint_disconnected event * occurs after a configurable delay * @param int $reachabilityDebouncingWindow The reachability event delay in * milliseconds * @param bool $webhooksFromRestEnabled Whether the Service instance should * call webhook_url when the REST API is * used to update Sync objects * @return UpdateServiceOptions Options builder */ public static function update(string $webhookUrl = Values::NONE, string $friendlyName = Values::NONE, bool $reachabilityWebhooksEnabled = Values::NONE, bool $aclEnabled = Values::NONE, bool $reachabilityDebouncingEnabled = Values::NONE, int $reachabilityDebouncingWindow = Values::NONE, bool $webhooksFromRestEnabled = Values::NONE): UpdateServiceOptions { return new UpdateServiceOptions($webhookUrl, $friendlyName, $reachabilityWebhooksEnabled, $aclEnabled, $reachabilityDebouncingEnabled, $reachabilityDebouncingWindow, $webhooksFromRestEnabled); } } class CreateServiceOptions extends Options { /** * @param string $friendlyName A string that you assign to describe the resource * @param string $webhookUrl The URL we should call when Sync objects are * manipulated * @param bool $reachabilityWebhooksEnabled Whether the service instance should * call webhook_url when client * endpoints connect to Sync * @param bool $aclEnabled Whether token identities in the Service must be * granted access to Sync objects by using the * Permissions resource * @param bool $reachabilityDebouncingEnabled Whether every * endpoint_disconnected event * occurs after a configurable delay * @param int $reachabilityDebouncingWindow The reachability event delay in * milliseconds * @param bool $webhooksFromRestEnabled Whether the Service instance should * call webhook_url when the REST API is * used to update Sync objects */ public function __construct(string $friendlyName = Values::NONE, string $webhookUrl = Values::NONE, bool $reachabilityWebhooksEnabled = Values::NONE, bool $aclEnabled = Values::NONE, bool $reachabilityDebouncingEnabled = Values::NONE, int $reachabilityDebouncingWindow = Values::NONE, bool $webhooksFromRestEnabled = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['webhookUrl'] = $webhookUrl; $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; $this->options['aclEnabled'] = $aclEnabled; $this->options['reachabilityDebouncingEnabled'] = $reachabilityDebouncingEnabled; $this->options['reachabilityDebouncingWindow'] = $reachabilityDebouncingWindow; $this->options['webhooksFromRestEnabled'] = $webhooksFromRestEnabled; } /** * A string that you assign to describe the resource. * * @param string $friendlyName A string that you assign to describe the resource * @return $this Fluent Builder */ public function setFriendlyName(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 * @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 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 * occurs after a configurable delay * @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 * @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 * @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 * @param bool $aclEnabled Whether token identities in the Service must be * granted access to Sync objects by using the * Permissions resource * @param bool $reachabilityDebouncingEnabled Whether every * endpoint_disconnected event * occurs after a configurable delay * @param int $reachabilityDebouncingWindow The reachability event delay in * milliseconds * @param bool $webhooksFromRestEnabled Whether the Service instance should * call webhook_url when the REST API is * used to update Sync objects */ public function __construct(string $webhookUrl = Values::NONE, string $friendlyName = Values::NONE, bool $reachabilityWebhooksEnabled = Values::NONE, bool $aclEnabled = Values::NONE, bool $reachabilityDebouncingEnabled = Values::NONE, int $reachabilityDebouncingWindow = Values::NONE, bool $webhooksFromRestEnabled = Values::NONE) { $this->options['webhookUrl'] = $webhookUrl; $this->options['friendlyName'] = $friendlyName; $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; $this->options['aclEnabled'] = $aclEnabled; $this->options['reachabilityDebouncingEnabled'] = $reachabilityDebouncingEnabled; $this->options['reachabilityDebouncingWindow'] = $reachabilityDebouncingWindow; $this->options['webhooksFromRestEnabled'] = $webhooksFromRestEnabled; } /** * The URL we should call when Sync objects are manipulated. * * @param string $webhookUrl The URL we should call when Sync objects are * manipulated * @return $this Fluent Builder */ public function setWebhookUrl(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 * @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 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 * occurs after a configurable delay * @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 * @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 * @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 . ']'; } } Sync/V1/ServicePage.php 0000644 00000002163 15107452346 0010665 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ServicePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Sync/V1.php 0000644 00000004226 15107452346 0006472 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Sync\V1\ServiceList; use Twilio\Version; /** * @property ServiceList $services * @method \Twilio\Rest\Sync\V1\ServiceContext services(string $sid) */ class V1 extends Version { protected $_services; /** * Construct the V1 version of Sync * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->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]'; } } Sync.php 0000644 00000004714 15107452346 0006206 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Sync\V1; /** * @property \Twilio\Rest\Sync\V1 $v1 * @property \Twilio\Rest\Sync\V1\ServiceList $services * @method \Twilio\Rest\Sync\V1\ServiceContext services(string $sid) */ class Sync extends Domain { protected $_v1; /** * Construct the Sync Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->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); } protected function getServices(): \Twilio\Rest\Sync\V1\ServiceList { return $this->v1->services; } /** * @param string $sid The SID of the Service resource to fetch */ protected function contextServices(string $sid): \Twilio\Rest\Sync\V1\ServiceContext { return $this->v1->services($sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync]'; } } Routes.php 0000644 00000006721 15107452346 0006553 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Routes\V2; /** * @property \Twilio\Rest\Routes\V2 $v2 * @property \Twilio\Rest\Routes\V2\PhoneNumberList $phoneNumbers * @property \Twilio\Rest\Routes\V2\SipDomainList $sipDomains * @property \Twilio\Rest\Routes\V2\TrunkList $trunks * @method \Twilio\Rest\Routes\V2\PhoneNumberContext phoneNumbers(string $phoneNumber) * @method \Twilio\Rest\Routes\V2\SipDomainContext sipDomains(string $sipDomain) * @method \Twilio\Rest\Routes\V2\TrunkContext trunks(string $sipTrunkDomain) */ class Routes extends Domain { protected $_v2; /** * Construct the Routes Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->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); } protected function getPhoneNumbers(): \Twilio\Rest\Routes\V2\PhoneNumberList { return $this->v2->phoneNumbers; } /** * @param string $phoneNumber The phone number */ protected function contextPhoneNumbers(string $phoneNumber): \Twilio\Rest\Routes\V2\PhoneNumberContext { return $this->v2->phoneNumbers($phoneNumber); } protected function getSipDomains(): \Twilio\Rest\Routes\V2\SipDomainList { return $this->v2->sipDomains; } /** * @param string $sipDomain The sip_domain */ protected function contextSipDomains(string $sipDomain): \Twilio\Rest\Routes\V2\SipDomainContext { return $this->v2->sipDomains($sipDomain); } protected function getTrunks(): \Twilio\Rest\Routes\V2\TrunkList { return $this->v2->trunks; } /** * @param string $sipTrunkDomain The SIP Trunk */ protected function contextTrunks(string $sipTrunkDomain): \Twilio\Rest\Routes\V2\TrunkContext { return $this->v2->trunks($sipTrunkDomain); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Routes]'; } } Monitor/V1/AlertInstance.php 0000644 00000011012 15107452346 0011730 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Monitor\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $alertText * @property string $apiVersion * @property \DateTime $dateCreated * @property \DateTime $dateGenerated * @property \DateTime $dateUpdated * @property string $errorCode * @property string $logLevel * @property string $moreInfo * @property string $requestMethod * @property string $requestUrl * @property string $requestVariables * @property string $resourceSid * @property string $responseBody * @property string $responseHeaders * @property string $sid * @property string $url * @property string $requestHeaders * @property string $serviceSid */ class AlertInstance extends InstanceResource { /** * Initialize the AlertInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Monitor/V1/EventList.php 0000644 00000012277 15107452346 0011127 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Monitor\V1; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class EventList extends ListResource { /** * Construct the EventList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Events'; } /** * Streams EventInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of EventInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 that identifies the 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]'; } } Monitor/V1/EventPage.php 0000644 00000002160 15107452346 0011056 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Monitor\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class EventPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Monitor/V1/AlertList.php 0000644 00000012031 15107452346 0011101 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Monitor\V1; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class AlertList extends ListResource { /** * Construct the AlertList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Alerts'; } /** * Streams AlertInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of AlertInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 that identifies the 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]'; } } Monitor/V1/AlertOptions.php 0000644 00000006350 15107452346 0011630 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Monitor\V1; use Twilio\Options; use Twilio\Values; abstract class AlertOptions { /** * @param string $logLevel Only show alerts for this log-level * @param \DateTime $startDate Only include alerts that occurred on or after * this date and time * @param \DateTime $endDate Only include alerts that occurred on or before * this date and time * @return ReadAlertOptions Options builder */ public static function read(string $logLevel = Values::NONE, \DateTime $startDate = Values::NONE, \DateTime $endDate = Values::NONE): ReadAlertOptions { return new ReadAlertOptions($logLevel, $startDate, $endDate); } } class ReadAlertOptions extends Options { /** * @param string $logLevel Only show alerts for this log-level * @param \DateTime $startDate Only include alerts that occurred on or after * this date and time * @param \DateTime $endDate Only include alerts that occurred on or before * this date and time */ public function __construct(string $logLevel = Values::NONE, \DateTime $startDate = Values::NONE, \DateTime $endDate = Values::NONE) { $this->options['logLevel'] = $logLevel; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; } /** * Only show alerts for this log-level. Can be: `error`, `warning`, `notice`, or `debug`. * * @param string $logLevel Only show alerts for this log-level * @return $this Fluent Builder */ public function setLogLevel(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 * @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 * @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 . ']'; } } Monitor/V1/EventOptions.php 0000644 00000012530 15107452346 0011637 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Monitor\V1; use Twilio\Options; use Twilio\Values; abstract class EventOptions { /** * @param string $actorSid Only include events initiated by this Actor * @param string $eventType Only include events of this Event Type * @param string $resourceSid Only include events that refer to this resource * @param string $sourceIpAddress Only include events that originated from this * IP address * @param \DateTime $startDate Only include events that occurred on or after * this date * @param \DateTime $endDate Only include events that occurred on or before * this date * @return ReadEventOptions Options builder */ public static function read(string $actorSid = Values::NONE, string $eventType = Values::NONE, string $resourceSid = Values::NONE, string $sourceIpAddress = Values::NONE, \DateTime $startDate = Values::NONE, \DateTime $endDate = Values::NONE): ReadEventOptions { return new ReadEventOptions($actorSid, $eventType, $resourceSid, $sourceIpAddress, $startDate, $endDate); } } class ReadEventOptions extends Options { /** * @param string $actorSid Only include events initiated by this Actor * @param string $eventType Only include events of this Event Type * @param string $resourceSid Only include events that refer to this resource * @param string $sourceIpAddress Only include events that originated from this * IP address * @param \DateTime $startDate Only include events that occurred on or after * this date * @param \DateTime $endDate Only include events that occurred on or before * this date */ public function __construct(string $actorSid = Values::NONE, string $eventType = Values::NONE, string $resourceSid = Values::NONE, string $sourceIpAddress = Values::NONE, \DateTime $startDate = Values::NONE, \DateTime $endDate = Values::NONE) { $this->options['actorSid'] = $actorSid; $this->options['eventType'] = $eventType; $this->options['resourceSid'] = $resourceSid; $this->options['sourceIpAddress'] = $sourceIpAddress; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; } /** * Only include events initiated by this Actor. Useful for auditing actions taken by specific users or API credentials. * * @param string $actorSid Only include events initiated by this Actor * @return $this Fluent Builder */ public function setActorSid(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 * @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 * @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 * @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 * @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 * @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 . ']'; } } Monitor/V1/EventContext.php 0000644 00000002703 15107452346 0011631 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Monitor\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class EventContext extends InstanceContext { /** * Initialize the EventContext * * @param Version $version Version that contains the resource * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Monitor/V1/AlertContext.php 0000644 00000002703 15107452346 0011617 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Monitor\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class AlertContext extends InstanceContext { /** * Initialize the AlertContext * * @param Version $version Version that contains the resource * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Monitor/V1/AlertPage.php 0000644 00000002160 15107452346 0011044 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Monitor\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AlertPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Monitor/V1/EventInstance.php 0000644 00000007574 15107452346 0011764 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Monitor\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $actorSid * @property string $actorType * @property string $description * @property array $eventData * @property \DateTime $eventDate * @property string $eventType * @property string $resourceSid * @property string $resourceType * @property string $sid * @property string $source * @property string $sourceIpAddress * @property string $url * @property array $links */ class EventInstance extends InstanceResource { /** * Initialize the EventInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Monitor/V1.php 0000644 00000004740 15107452346 0007206 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Monitor; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Monitor\V1\AlertList; use Twilio\Rest\Monitor\V1\EventList; use Twilio\Version; /** * @property AlertList $alerts * @property EventList $events * @method \Twilio\Rest\Monitor\V1\AlertContext alerts(string $sid) * @method \Twilio\Rest\Monitor\V1\EventContext events(string $sid) */ class V1 extends Version { protected $_alerts; protected $_events; /** * Construct the V1 version of Monitor * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->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]'; } } Messaging.php 0000644 00000013324 15107452346 0007204 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Messaging\V1; /** * @property \Twilio\Rest\Messaging\V1 $v1 * @property \Twilio\Rest\Messaging\V1\BrandRegistrationList $brandRegistrations * @property \Twilio\Rest\Messaging\V1\DeactivationsList $deactivations * @property \Twilio\Rest\Messaging\V1\DomainCertsList $domainCerts * @property \Twilio\Rest\Messaging\V1\DomainConfigList $domainConfig * @property \Twilio\Rest\Messaging\V1\ExternalCampaignList $externalCampaign * @property \Twilio\Rest\Messaging\V1\ServiceList $services * @property \Twilio\Rest\Messaging\V1\TollfreeVerificationList $tollfreeVerifications * @property \Twilio\Rest\Messaging\V1\UsecaseList $usecases * @method \Twilio\Rest\Messaging\V1\BrandRegistrationContext brandRegistrations(string $sid) * @method \Twilio\Rest\Messaging\V1\DeactivationsContext deactivations() * @method \Twilio\Rest\Messaging\V1\DomainCertsContext domainCerts(string $domainSid) * @method \Twilio\Rest\Messaging\V1\DomainConfigContext domainConfig(string $domainSid) * @method \Twilio\Rest\Messaging\V1\ServiceContext services(string $sid) * @method \Twilio\Rest\Messaging\V1\TollfreeVerificationContext tollfreeVerifications(string $sid) */ class Messaging extends Domain { protected $_v1; /** * Construct the Messaging Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->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); } protected function getBrandRegistrations(): \Twilio\Rest\Messaging\V1\BrandRegistrationList { return $this->v1->brandRegistrations; } /** * @param string $sid The SID that identifies the resource to fetch */ protected function contextBrandRegistrations(string $sid): \Twilio\Rest\Messaging\V1\BrandRegistrationContext { return $this->v1->brandRegistrations($sid); } protected function getDeactivations(): \Twilio\Rest\Messaging\V1\DeactivationsList { return $this->v1->deactivations; } protected function contextDeactivations(): \Twilio\Rest\Messaging\V1\DeactivationsContext { return $this->v1->deactivations(); } protected function getDomainCerts(): \Twilio\Rest\Messaging\V1\DomainCertsList { return $this->v1->domainCerts; } /** * @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 { return $this->v1->domainCerts($domainSid); } protected function getDomainConfig(): \Twilio\Rest\Messaging\V1\DomainConfigList { return $this->v1->domainConfig; } /** * @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 { return $this->v1->domainConfig($domainSid); } protected function getExternalCampaign(): \Twilio\Rest\Messaging\V1\ExternalCampaignList { return $this->v1->externalCampaign; } protected function getServices(): \Twilio\Rest\Messaging\V1\ServiceList { return $this->v1->services; } /** * @param string $sid The SID that identifies the resource to fetch */ protected function contextServices(string $sid): \Twilio\Rest\Messaging\V1\ServiceContext { return $this->v1->services($sid); } protected function getTollfreeVerifications(): \Twilio\Rest\Messaging\V1\TollfreeVerificationList { return $this->v1->tollfreeVerifications; } /** * @param string $sid Tollfree Verification Sid */ protected function contextTollfreeVerifications(string $sid): \Twilio\Rest\Messaging\V1\TollfreeVerificationContext { return $this->v1->tollfreeVerifications($sid); } protected function getUsecases(): \Twilio\Rest\Messaging\V1\UsecaseList { return $this->v1->usecases; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging]'; } } Accounts.php 0000644 00000006221 15107452346 0007044 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Accounts\V1; /** * @property \Twilio\Rest\Accounts\V1 $v1 * @property \Twilio\Rest\Accounts\V1\AuthTokenPromotionList $authTokenPromotion * @property \Twilio\Rest\Accounts\V1\CredentialList $credentials * @property \Twilio\Rest\Accounts\V1\SecondaryAuthTokenList $secondaryAuthToken * @method \Twilio\Rest\Accounts\V1\AuthTokenPromotionContext authTokenPromotion() * @method \Twilio\Rest\Accounts\V1\SecondaryAuthTokenContext secondaryAuthToken() */ class Accounts extends Domain { protected $_v1; /** * Construct the Accounts Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->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); } protected function getAuthTokenPromotion(): \Twilio\Rest\Accounts\V1\AuthTokenPromotionList { return $this->v1->authTokenPromotion; } protected function contextAuthTokenPromotion(): \Twilio\Rest\Accounts\V1\AuthTokenPromotionContext { return $this->v1->authTokenPromotion(); } protected function getCredentials(): \Twilio\Rest\Accounts\V1\CredentialList { return $this->v1->credentials; } protected function getSecondaryAuthToken(): \Twilio\Rest\Accounts\V1\SecondaryAuthTokenList { return $this->v1->secondaryAuthToken; } protected function contextSecondaryAuthToken(): \Twilio\Rest\Accounts\V1\SecondaryAuthTokenContext { return $this->v1->secondaryAuthToken(); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Accounts]'; } } FrontlineApi/V1/UserInstance.php 0000644 00000007063 15107452346 0012555 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FrontlineApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $identity * @property string $friendlyName * @property string $avatar * @property string $state * @property bool $isAvailable * @property string $url */ class UserInstance extends InstanceResource { /** * Initialize the UserInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the User resource to fetch */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } FrontlineApi/V1/UserOptions.php 0000644 00000007153 15107452346 0012444 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FrontlineApi\V1; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ abstract class UserOptions { /** * @param string $friendlyName The string that you assigned to describe the User * @param string $avatar The avatar URL which will be shown in Frontline * application * @param string $state Current state of this user * @param bool $isAvailable Whether the User is available for new conversations * @return UpdateUserOptions Options builder */ public static function update(string $friendlyName = Values::NONE, string $avatar = Values::NONE, string $state = Values::NONE, bool $isAvailable = Values::NONE): UpdateUserOptions { return new UpdateUserOptions($friendlyName, $avatar, $state, $isAvailable); } } class UpdateUserOptions extends Options { /** * @param string $friendlyName The string that you assigned to describe the User * @param string $avatar The avatar URL which will be shown in Frontline * application * @param string $state Current state of this user * @param bool $isAvailable Whether the User is available for new conversations */ public function __construct(string $friendlyName = Values::NONE, string $avatar = Values::NONE, string $state = Values::NONE, bool $isAvailable = Values::NONE) { $this->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; } /** * Current state of this user. Can be either `active` or `deactivated`. * * @param string $state Current state of this user * @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 * @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 . ']'; } } FrontlineApi/V1/UserContext.php 0000644 00000004511 15107452346 0012430 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FrontlineApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class UserContext extends InstanceContext { /** * Initialize the UserContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the User resource to fetch */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } FrontlineApi/V1/UserPage.php 0000644 00000002352 15107452346 0011661 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FrontlineApi\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class UserPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } FrontlineApi/V1/UserList.php 0000644 00000002076 15107452346 0011723 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FrontlineApi\V1; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class UserList extends ListResource { /** * Construct the UserList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; } /** * Constructs a UserContext * * @param string $sid The SID 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]'; } } FrontlineApi/V1.php 0000644 00000004232 15107452346 0010145 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FrontlineApi; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\FrontlineApi\V1\UserList; use Twilio\Version; /** * @property UserList $users * @method \Twilio\Rest\FrontlineApi\V1\UserContext users(string $sid) */ class V1 extends Version { protected $_users; /** * Construct the V1 version of FrontlineApi * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->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]'; } } Notify/V1/CredentialPage.php 0000644 00000002374 15107452346 0011677 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class CredentialPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Notify/V1/CredentialOptions.php 0000644 00000027071 15107452346 0012457 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ abstract class CredentialOptions { /** * @param string $friendlyName A string to describe the resource * @param string $certificate [APN only] The URL-encoded representation of the * certificate * @param string $privateKey [APN only] URL-encoded representation of the * private key * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @param string $apiKey [GCM only] The `Server key` of your project from * Firebase console under Settings / Cloud messaging * @param string $secret [FCM only] The `Server key` of your project from * Firebase console under Settings / Cloud messaging * @return CreateCredentialOptions Options builder */ public static function create(string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::NONE, string $apiKey = Values::NONE, string $secret = Values::NONE): CreateCredentialOptions { return new CreateCredentialOptions($friendlyName, $certificate, $privateKey, $sandbox, $apiKey, $secret); } /** * @param string $friendlyName A string to describe the resource * @param string $certificate [APN only] The URL-encoded representation of the * certificate * @param string $privateKey [APN only] URL-encoded representation of the * private key * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @param string $apiKey [GCM only] The `Server key` of your project from * Firebase console under Settings / Cloud messaging * @param string $secret [FCM only] The `Server key` of your project from * Firebase console under Settings / Cloud messaging * @return UpdateCredentialOptions Options builder */ public static function update(string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::NONE, string $apiKey = Values::NONE, string $secret = Values::NONE): UpdateCredentialOptions { return new UpdateCredentialOptions($friendlyName, $certificate, $privateKey, $sandbox, $apiKey, $secret); } } class CreateCredentialOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $certificate [APN only] The URL-encoded representation of the * certificate * @param string $privateKey [APN only] URL-encoded representation of the * private key * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @param string $apiKey [GCM only] The `Server key` of your project from * Firebase console under Settings / Cloud messaging * @param string $secret [FCM only] The `Server key` of your project from * Firebase console under Settings / Cloud messaging */ public function __construct(string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::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 string to describe the resource * @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 * @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] URL-encoded representation of the * 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 * @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 string to describe the resource * @param string $certificate [APN only] The URL-encoded representation of the * certificate * @param string $privateKey [APN only] URL-encoded representation of the * private key * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @param string $apiKey [GCM only] The `Server key` of your project from * Firebase console under Settings / Cloud messaging * @param string $secret [FCM only] The `Server key` of your project from * Firebase console under Settings / Cloud messaging */ public function __construct(string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::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 string to describe the resource * @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 * @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] URL-encoded representation of the * 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 * @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 . ']'; } } Notify/V1/Service/BindingContext.php 0000644 00000004150 15107452346 0013341 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class BindingContext extends InstanceContext { /** * Initialize the BindingContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Bindings/' . \rawurlencode($sid) . ''; } /** * Fetch the BindingInstance * * @return BindingInstance Fetched BindingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): BindingInstance { $payload = $this->version->fetch('GET', $this->uri); return new BindingInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Delete the BindingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Notify/V1/Service/BindingOptions.php 0000644 00000017773 15107452346 0013367 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1\Service; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ abstract class BindingOptions { /** * @param string[] $tag A tag that can be used to select the Bindings to notify * @param string $notificationProtocolVersion The protocol version to use to * send the notification * @param string $credentialSid The SID of the Credential resource to be used * to send notifications to this Binding * @param string $endpoint Deprecated * @return CreateBindingOptions Options builder */ public static function create(array $tag = Values::ARRAY_NONE, string $notificationProtocolVersion = Values::NONE, string $credentialSid = Values::NONE, string $endpoint = Values::NONE): CreateBindingOptions { return new CreateBindingOptions($tag, $notificationProtocolVersion, $credentialSid, $endpoint); } /** * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param string[] $identity The `identity` value of the resources to read * @param string[] $tag Only list Bindings that have all of the specified Tags * @return ReadBindingOptions Options builder */ public static function read(\DateTime $startDate = Values::NONE, \DateTime $endDate = Values::NONE, array $identity = Values::ARRAY_NONE, array $tag = Values::ARRAY_NONE): ReadBindingOptions { return new ReadBindingOptions($startDate, $endDate, $identity, $tag); } } class CreateBindingOptions extends Options { /** * @param string[] $tag A tag that can be used to select the Bindings to notify * @param string $notificationProtocolVersion The protocol version to use to * send the notification * @param string $credentialSid The SID of the Credential resource to be used * to send notifications to this Binding * @param string $endpoint Deprecated */ public function __construct(array $tag = Values::ARRAY_NONE, string $notificationProtocolVersion = Values::NONE, string $credentialSid = Values::NONE, string $endpoint = Values::NONE) { $this->options['tag'] = $tag; $this->options['notificationProtocolVersion'] = $notificationProtocolVersion; $this->options['credentialSid'] = $credentialSid; $this->options['endpoint'] = $endpoint; } /** * A tag that can be used to select the Bindings to notify. Repeat this parameter to specify more than one tag, up to a total of 20 tags. * * @param string[] $tag A tag that can be used to select the Bindings to notify * @return $this Fluent Builder */ public function setTag(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 * @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 resource to be used * to send notifications to this Binding * @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 * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param string[] $identity The `identity` value of the resources to read * @param string[] $tag Only list Bindings that have all of the specified Tags */ public function __construct(\DateTime $startDate = Values::NONE, \DateTime $endDate = Values::NONE, 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 * @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 * @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 `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 * @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 . ']'; } } Notify/V1/Service/NotificationList.php 0000644 00000005606 15107452346 0013713 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class NotificationList extends ListResource { /** * Construct the NotificationList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with */ public function __construct(Version $version, string $serviceSid) { parent::__construct($version); // Path Solution $this->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([ 'Identity' => Serialize::map($options['identity'], function($e) { return $e; }), 'Tag' => Serialize::map($options['tag'], function($e) { return $e; }), 'Body' => $options['body'], 'Priority' => $options['priority'], 'Ttl' => $options['ttl'], 'Title' => $options['title'], 'Sound' => $options['sound'], 'Action' => $options['action'], 'Data' => Serialize::jsonObject($options['data']), 'Apn' => Serialize::jsonObject($options['apn']), 'Gcm' => Serialize::jsonObject($options['gcm']), 'Sms' => Serialize::jsonObject($options['sms']), 'FacebookMessenger' => Serialize::jsonObject($options['facebookMessenger']), 'Fcm' => Serialize::jsonObject($options['fcm']), 'Segment' => Serialize::map($options['segment'], function($e) { return $e; }), 'Alexa' => Serialize::jsonObject($options['alexa']), 'ToBinding' => Serialize::map($options['toBinding'], function($e) { return $e; }), 'DeliveryCallbackUrl' => $options['deliveryCallbackUrl'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); 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]'; } } Notify/V1/Service/NotificationPage.php 0000644 00000002467 15107452346 0013656 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class NotificationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Notify/V1/Service/NotificationInstance.php 0000644 00000007176 15107452347 0014551 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property \DateTime $dateCreated * @property string[] $identities * @property string[] $tags * @property string[] $segments * @property string $priority * @property int $ttl * @property string $title * @property string $body * @property string $sound * @property string $action * @property array $data * @property array $apn * @property array $gcm * @property array $fcm * @property array $sms * @property array $facebookMessenger * @property array $alexa */ class NotificationInstance extends InstanceResource { /** * Initialize the NotificationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with */ public function __construct(Version $version, array $payload, string $serviceSid) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Notify/V1/Service/NotificationOptions.php 0000644 00000041631 15107452347 0014432 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1\Service; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ abstract class NotificationOptions { /** * @param string[] $identity The `identity` value that identifies the new * resource's User * @param string[] $tag A tag that selects the Bindings to notify * @param string $body The notification body text * @param string $priority The priority of the notification * @param int $ttl How long, in seconds, the notification is valid * @param string $title The notification title * @param string $sound The name of the sound to be played for the notification * @param string $action The actions to display for the notification * @param array $data The custom key-value pairs of the notification's payload * @param array $apn The APNS-specific payload that overrides corresponding * attributes in a generic payload for APNS Bindings * @param array $gcm The GCM-specific payload that overrides corresponding * attributes in generic payload for GCM Bindings * @param array $sms The SMS-specific payload that overrides corresponding * attributes in generic payload for SMS Bindings * @param array $facebookMessenger Deprecated * @param array $fcm The FCM-specific payload that overrides corresponding * attributes in generic payload for FCM Bindings * @param string[] $segment A Segment to notify * @param array $alexa Deprecated * @param string[] $toBinding The destination address specified as a JSON string * @param string $deliveryCallbackUrl URL to send webhooks * @return CreateNotificationOptions Options builder */ public static function create(array $identity = Values::ARRAY_NONE, array $tag = Values::ARRAY_NONE, string $body = Values::NONE, string $priority = Values::NONE, int $ttl = Values::NONE, string $title = Values::NONE, string $sound = Values::NONE, string $action = Values::NONE, array $data = Values::ARRAY_NONE, array $apn = Values::ARRAY_NONE, array $gcm = Values::ARRAY_NONE, array $sms = Values::ARRAY_NONE, array $facebookMessenger = Values::ARRAY_NONE, array $fcm = Values::ARRAY_NONE, array $segment = Values::ARRAY_NONE, array $alexa = Values::ARRAY_NONE, array $toBinding = Values::ARRAY_NONE, string $deliveryCallbackUrl = Values::NONE): CreateNotificationOptions { return new CreateNotificationOptions($identity, $tag, $body, $priority, $ttl, $title, $sound, $action, $data, $apn, $gcm, $sms, $facebookMessenger, $fcm, $segment, $alexa, $toBinding, $deliveryCallbackUrl); } } class CreateNotificationOptions extends Options { /** * @param string[] $identity The `identity` value that identifies the new * resource's User * @param string[] $tag A tag that selects the Bindings to notify * @param string $body The notification body text * @param string $priority The priority of the notification * @param int $ttl How long, in seconds, the notification is valid * @param string $title The notification title * @param string $sound The name of the sound to be played for the notification * @param string $action The actions to display for the notification * @param array $data The custom key-value pairs of the notification's payload * @param array $apn The APNS-specific payload that overrides corresponding * attributes in a generic payload for APNS Bindings * @param array $gcm The GCM-specific payload that overrides corresponding * attributes in generic payload for GCM Bindings * @param array $sms The SMS-specific payload that overrides corresponding * attributes in generic payload for SMS Bindings * @param array $facebookMessenger Deprecated * @param array $fcm The FCM-specific payload that overrides corresponding * attributes in generic payload for FCM Bindings * @param string[] $segment A Segment to notify * @param array $alexa Deprecated * @param string[] $toBinding The destination address specified as a JSON string * @param string $deliveryCallbackUrl URL to send webhooks */ public function __construct(array $identity = Values::ARRAY_NONE, array $tag = Values::ARRAY_NONE, string $body = Values::NONE, string $priority = Values::NONE, int $ttl = Values::NONE, string $title = Values::NONE, string $sound = Values::NONE, string $action = Values::NONE, array $data = Values::ARRAY_NONE, array $apn = Values::ARRAY_NONE, array $gcm = Values::ARRAY_NONE, array $sms = Values::ARRAY_NONE, array $facebookMessenger = Values::ARRAY_NONE, array $fcm = Values::ARRAY_NONE, array $segment = Values::ARRAY_NONE, array $alexa = Values::ARRAY_NONE, array $toBinding = Values::ARRAY_NONE, string $deliveryCallbackUrl = Values::NONE) { $this->options['identity'] = $identity; $this->options['tag'] = $tag; $this->options['body'] = $body; $this->options['priority'] = $priority; $this->options['ttl'] = $ttl; $this->options['title'] = $title; $this->options['sound'] = $sound; $this->options['action'] = $action; $this->options['data'] = $data; $this->options['apn'] = $apn; $this->options['gcm'] = $gcm; $this->options['sms'] = $sms; $this->options['facebookMessenger'] = $facebookMessenger; $this->options['fcm'] = $fcm; $this->options['segment'] = $segment; $this->options['alexa'] = $alexa; $this->options['toBinding'] = $toBinding; $this->options['deliveryCallbackUrl'] = $deliveryCallbackUrl; } /** * The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/chat/rest/user-resource) within the [Service](https://www.twilio.com/docs/notify/api/service-resource). Delivery will be attempted only to Bindings with an Identity in this list. No more than 20 items are allowed in this list. * * @param string[] $identity The `identity` value that identifies the new * resource's User * @return $this Fluent Builder */ public function setIdentity(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 * @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 body text * @return $this Fluent Builder */ public function setBody(string $body): self { $this->options['body'] = $body; return $this; } /** * The priority of the notification. Can be: `low` or `high` and the default is `high`. A value of `low` optimizes the client app's battery consumption; however, notifications may be delivered with unspecified delay. For FCM and GCM, `low` priority is the same as `Normal` priority. For APNS `low` priority is the same as `5`. A value of `high` sends the notification immediately, and can wake up a sleeping device. For FCM and GCM, `high` is the same as `High` priority. For APNS, `high` is a priority `10`. SMS does not support this property. * * @param string $priority The priority of the notification * @return $this Fluent Builder */ public function setPriority(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 * @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 * @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 * @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 * @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 * @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 a generic payload for APNS Bindings * @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 generic payload for GCM Bindings * @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/send-messages) resource. These parameters of the Message resource are supported in snake case format: `body`, `media_urls`, `status_callback`, and `max_price`. The `status_callback` parameter overrides the corresponding parameter in the messaging service, if configured. The `media_urls` property expects a JSON array. * * @param array $sms The SMS-specific payload that overrides corresponding * attributes in generic payload for SMS Bindings * @return $this Fluent Builder */ public function setSms(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 generic payload for FCM Bindings * @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 A Segment to notify * @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 * @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 . ']'; } } Notify/V1/Service/BindingPage.php 0000644 00000002431 15107452347 0012572 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class BindingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Notify/V1/Service/BindingInstance.php 0000644 00000011122 15107452347 0013457 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $credentialSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $notificationProtocolVersion * @property string $endpoint * @property string $identity * @property string $bindingType * @property string $address * @property string[] $tags * @property string $url * @property array $links */ class BindingInstance extends InstanceResource { /** * Initialize the BindingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the BindingInstance * * @return BindingInstance Fetched BindingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): BindingInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Notify/V1/Service/BindingList.php 0000644 00000015450 15107452347 0012636 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class BindingList extends ListResource { /** * Construct the BindingList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with */ public function __construct(Version $version, string $serviceSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Bindings'; } /** * Create the BindingInstance * * @param string $identity The `identity` value that identifies the new * resource's User * @param string $bindingType The type of the Binding * @param string $address The channel-specific address * @param array|Options $options Optional Arguments * @return BindingInstance 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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new BindingInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams BindingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of BindingInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 unique string that identifies the resource */ 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]'; } } Notify/V1/ServiceInstance.php 0000644 00000014370 15107452347 0012115 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Notify\V1\Service\BindingList; use Twilio\Rest\Notify\V1\Service\NotificationList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $apnCredentialSid * @property string $gcmCredentialSid * @property string $fcmCredentialSid * @property string $messagingServiceSid * @property string $facebookMessengerPageId * @property string $defaultApnNotificationProtocolVersion * @property string $defaultGcmNotificationProtocolVersion * @property string $defaultFcmNotificationProtocolVersion * @property bool $logEnabled * @property string $url * @property array $links * @property string $alexaSkillId * @property string $defaultAlexaNotificationProtocolVersion * @property string $deliveryCallbackUrl * @property bool $deliveryCallbackEnabled */ class ServiceInstance extends InstanceResource { protected $_bindings; protected $_notifications; /** * Initialize the ServiceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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 bindings */ protected function getBindings(): BindingList { return $this->proxy()->bindings; } /** * 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.Notify.V1.ServiceInstance ' . \implode(' ', $context) . ']'; } } Notify/V1/ServiceList.php 0000644 00000015301 15107452347 0011257 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ServiceList extends ListResource { /** * Construct the ServiceList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ServiceInstance($this->version, $payload); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 unique string that identifies the 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.Notify.V1.ServiceList]'; } } Notify/V1/ServiceContext.php 0000644 00000013017 15107452347 0011772 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Notify\V1\Service\BindingList; use Twilio\Rest\Notify\V1\Service\NotificationList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property BindingList $bindings * @property NotificationList $notifications * @method \Twilio\Rest\Notify\V1\Service\BindingContext bindings(string $sid) */ class ServiceContext extends InstanceContext { protected $_bindings; protected $_notifications; /** * Initialize the ServiceContext * * @param Version $version Version that contains the resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->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 { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { $payload = $this->version->fetch('GET', $this->uri); 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']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Access the bindings */ protected function getBindings(): BindingList { if (!$this->_bindings) { $this->_bindings = new BindingList($this->version, $this->solution['sid']); } return $this->_bindings; } /** * Access the notifications */ protected function getNotifications(): NotificationList { if (!$this->_notifications) { $this->_notifications = new NotificationList($this->version, $this->solution['sid']); } return $this->_notifications; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return 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) . ']'; } } Notify/V1/CredentialContext.php 0000644 00000005432 15107452347 0012446 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class CredentialContext extends InstanceContext { /** * Initialize the CredentialContext * * @param Version $version Version that contains the resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Credentials/' . \rawurlencode($sid) . ''; } /** * Fetch the CredentialInstance * * @return CredentialInstance Fetched CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new CredentialInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the CredentialInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Notify/V1/CredentialList.php 0000644 00000013260 15107452347 0011733 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class CredentialList extends ListResource { /** * Construct the CredentialList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Credentials'; } /** * Streams CredentialInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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); } /** * Create the CredentialInstance * * @param string $type The Credential 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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CredentialInstance($this->version, $payload); } /** * Constructs a CredentialContext * * @param string $sid The unique string that identifies the 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.Notify.V1.CredentialList]'; } } Notify/V1/CredentialInstance.php 0000644 00000010122 15107452347 0012556 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $friendlyName * @property string $type * @property string $sandbox * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class CredentialInstance extends InstanceResource { /** * Initialize the CredentialInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Notify/V1/ServiceOptions.php 0000644 00000067705 15107452347 0012016 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ abstract class ServiceOptions { /** * @param string $friendlyName A string to describe the resource * @param string $apnCredentialSid The SID of the Credential to use for APN * Bindings * @param string $gcmCredentialSid The SID of the Credential to use for GCM * Bindings * @param string $messagingServiceSid The SID of the Messaging Service to use * for SMS Bindings * @param string $facebookMessengerPageId Deprecated * @param string $defaultApnNotificationProtocolVersion The protocol version to * use for sending APNS * notifications * @param string $defaultGcmNotificationProtocolVersion The protocol version to * use for sending GCM * notifications * @param string $fcmCredentialSid The SID of the Credential to use for FCM * Bindings * @param string $defaultFcmNotificationProtocolVersion The protocol version to * use for sending FCM * notifications * @param bool $logEnabled Whether to log notifications * @param string $alexaSkillId Deprecated * @param string $defaultAlexaNotificationProtocolVersion Deprecated * @param string $deliveryCallbackUrl Webhook URL * @param bool $deliveryCallbackEnabled Enable delivery callbacks * @return CreateServiceOptions Options builder */ public static function create(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::NONE, string $alexaSkillId = Values::NONE, string $defaultAlexaNotificationProtocolVersion = Values::NONE, string $deliveryCallbackUrl = Values::NONE, bool $deliveryCallbackEnabled = Values::NONE): CreateServiceOptions { return new CreateServiceOptions($friendlyName, $apnCredentialSid, $gcmCredentialSid, $messagingServiceSid, $facebookMessengerPageId, $defaultApnNotificationProtocolVersion, $defaultGcmNotificationProtocolVersion, $fcmCredentialSid, $defaultFcmNotificationProtocolVersion, $logEnabled, $alexaSkillId, $defaultAlexaNotificationProtocolVersion, $deliveryCallbackUrl, $deliveryCallbackEnabled); } /** * @param string $friendlyName The string that identifies the Service resources * to read * @return ReadServiceOptions Options builder */ public static function read(string $friendlyName = Values::NONE): ReadServiceOptions { return new ReadServiceOptions($friendlyName); } /** * @param string $friendlyName A string to describe the resource * @param string $apnCredentialSid The SID of the Credential to use for APN * Bindings * @param string $gcmCredentialSid The SID of the Credential to use for GCM * Bindings * @param string $messagingServiceSid The SID of the Messaging Service to use * for SMS Bindings * @param string $facebookMessengerPageId Deprecated * @param string $defaultApnNotificationProtocolVersion The protocol version to * use for sending APNS * notifications * @param string $defaultGcmNotificationProtocolVersion The protocol version to * use for sending GCM * notifications * @param string $fcmCredentialSid The SID of the Credential to use for FCM * Bindings * @param string $defaultFcmNotificationProtocolVersion The protocol version to * use for sending FCM * notifications * @param bool $logEnabled Whether to log notifications * @param string $alexaSkillId Deprecated * @param string $defaultAlexaNotificationProtocolVersion Deprecated * @param string $deliveryCallbackUrl Webhook URL * @param bool $deliveryCallbackEnabled Enable delivery callbacks * @return UpdateServiceOptions Options builder */ public static function update(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::NONE, string $alexaSkillId = Values::NONE, string $defaultAlexaNotificationProtocolVersion = Values::NONE, string $deliveryCallbackUrl = Values::NONE, bool $deliveryCallbackEnabled = Values::NONE): UpdateServiceOptions { return new UpdateServiceOptions($friendlyName, $apnCredentialSid, $gcmCredentialSid, $messagingServiceSid, $facebookMessengerPageId, $defaultApnNotificationProtocolVersion, $defaultGcmNotificationProtocolVersion, $fcmCredentialSid, $defaultFcmNotificationProtocolVersion, $logEnabled, $alexaSkillId, $defaultAlexaNotificationProtocolVersion, $deliveryCallbackUrl, $deliveryCallbackEnabled); } } class CreateServiceOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $apnCredentialSid The SID of the Credential to use for APN * Bindings * @param string $gcmCredentialSid The SID of the Credential to use for GCM * Bindings * @param string $messagingServiceSid The SID of the Messaging Service to use * for SMS Bindings * @param string $facebookMessengerPageId Deprecated * @param string $defaultApnNotificationProtocolVersion The protocol version to * use for sending APNS * notifications * @param string $defaultGcmNotificationProtocolVersion The protocol version to * use for sending GCM * notifications * @param string $fcmCredentialSid The SID of the Credential to use for FCM * Bindings * @param string $defaultFcmNotificationProtocolVersion The protocol version to * use for sending FCM * notifications * @param bool $logEnabled Whether to log notifications * @param string $alexaSkillId Deprecated * @param string $defaultAlexaNotificationProtocolVersion Deprecated * @param string $deliveryCallbackUrl Webhook URL * @param bool $deliveryCallbackEnabled Enable delivery callbacks */ 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::NONE, string $alexaSkillId = Values::NONE, string $defaultAlexaNotificationProtocolVersion = Values::NONE, string $deliveryCallbackUrl = Values::NONE, bool $deliveryCallbackEnabled = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['apnCredentialSid'] = $apnCredentialSid; $this->options['gcmCredentialSid'] = $gcmCredentialSid; $this->options['messagingServiceSid'] = $messagingServiceSid; $this->options['facebookMessengerPageId'] = $facebookMessengerPageId; $this->options['defaultApnNotificationProtocolVersion'] = $defaultApnNotificationProtocolVersion; $this->options['defaultGcmNotificationProtocolVersion'] = $defaultGcmNotificationProtocolVersion; $this->options['fcmCredentialSid'] = $fcmCredentialSid; $this->options['defaultFcmNotificationProtocolVersion'] = $defaultFcmNotificationProtocolVersion; $this->options['logEnabled'] = $logEnabled; $this->options['alexaSkillId'] = $alexaSkillId; $this->options['defaultAlexaNotificationProtocolVersion'] = $defaultAlexaNotificationProtocolVersion; $this->options['deliveryCallbackUrl'] = $deliveryCallbackUrl; $this->options['deliveryCallbackEnabled'] = $deliveryCallbackEnabled; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName(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 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 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/send-messages#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. * * @param string $messagingServiceSid The SID of the Messaging Service to use * for SMS Bindings * @return $this Fluent Builder */ public function setMessagingServiceSid(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 * @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 * @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 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 * @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 * @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 Webhook URL * @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 Enable delivery callbacks * @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 string to describe the resource * @param string $apnCredentialSid The SID of the Credential to use for APN * Bindings * @param string $gcmCredentialSid The SID of the Credential to use for GCM * Bindings * @param string $messagingServiceSid The SID of the Messaging Service to use * for SMS Bindings * @param string $facebookMessengerPageId Deprecated * @param string $defaultApnNotificationProtocolVersion The protocol version to * use for sending APNS * notifications * @param string $defaultGcmNotificationProtocolVersion The protocol version to * use for sending GCM * notifications * @param string $fcmCredentialSid The SID of the Credential to use for FCM * Bindings * @param string $defaultFcmNotificationProtocolVersion The protocol version to * use for sending FCM * notifications * @param bool $logEnabled Whether to log notifications * @param string $alexaSkillId Deprecated * @param string $defaultAlexaNotificationProtocolVersion Deprecated * @param string $deliveryCallbackUrl Webhook URL * @param bool $deliveryCallbackEnabled Enable delivery callbacks */ public function __construct(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::NONE, string $alexaSkillId = Values::NONE, string $defaultAlexaNotificationProtocolVersion = Values::NONE, string $deliveryCallbackUrl = Values::NONE, bool $deliveryCallbackEnabled = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['apnCredentialSid'] = $apnCredentialSid; $this->options['gcmCredentialSid'] = $gcmCredentialSid; $this->options['messagingServiceSid'] = $messagingServiceSid; $this->options['facebookMessengerPageId'] = $facebookMessengerPageId; $this->options['defaultApnNotificationProtocolVersion'] = $defaultApnNotificationProtocolVersion; $this->options['defaultGcmNotificationProtocolVersion'] = $defaultGcmNotificationProtocolVersion; $this->options['fcmCredentialSid'] = $fcmCredentialSid; $this->options['defaultFcmNotificationProtocolVersion'] = $defaultFcmNotificationProtocolVersion; $this->options['logEnabled'] = $logEnabled; $this->options['alexaSkillId'] = $alexaSkillId; $this->options['defaultAlexaNotificationProtocolVersion'] = $defaultAlexaNotificationProtocolVersion; $this->options['deliveryCallbackUrl'] = $deliveryCallbackUrl; $this->options['deliveryCallbackEnabled'] = $deliveryCallbackEnabled; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName(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 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 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/send-messages#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. * * @param string $messagingServiceSid The SID of the Messaging Service to use * for SMS Bindings * @return $this Fluent Builder */ public function setMessagingServiceSid(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 * @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 * @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 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 * @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 * @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 Webhook URL * @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 Enable delivery callbacks * @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 . ']'; } } Notify/V1/ServicePage.php 0000644 00000002352 15107452347 0011222 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ServicePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Notify/V1.php 0000644 00000005055 15107452347 0007030 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Notify\V1\CredentialList; use Twilio\Rest\Notify\V1\ServiceList; use Twilio\Version; /** * @property CredentialList $credentials * @property ServiceList $services * @method \Twilio\Rest\Notify\V1\CredentialContext credentials(string $sid) * @method \Twilio\Rest\Notify\V1\ServiceContext services(string $sid) */ class V1 extends Version { protected $_credentials; protected $_services; /** * Construct the V1 version of Notify * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->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]'; } } Autopilot/V1/RestoreAssistantPage.php 0000644 00000002603 15107452347 0013646 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class RestoreAssistantPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return RestoreAssistantInstance \Twilio\Rest\Autopilot\V1\RestoreAssistantInstance */ public function buildInstance(array $payload): RestoreAssistantInstance { return new RestoreAssistantInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Autopilot.V1.RestoreAssistantPage]'; } } Autopilot/V1/RestoreAssistantList.php 0000644 00000003141 15107452347 0013703 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class RestoreAssistantList extends ListResource { /** * Construct the RestoreAssistantList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Assistants/Restore'; } /** * Update the RestoreAssistantInstance * * @param string $assistant The unique string that identifies the resource * @return RestoreAssistantInstance Updated RestoreAssistantInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $assistant): RestoreAssistantInstance { $data = Values::of(['Assistant' => $assistant, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new RestoreAssistantInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Autopilot.V1.RestoreAssistantList]'; } } Autopilot/V1/Assistant/WebhookPage.php 0000644 00000002602 15107452347 0013677 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class WebhookPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return WebhookInstance \Twilio\Rest\Autopilot\V1\Assistant\WebhookInstance */ public function buildInstance(array $payload): WebhookInstance { return new WebhookInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Autopilot.V1.WebhookPage]'; } } Autopilot/V1/Assistant/ModelBuildOptions.php 0000644 00000010751 15107452347 0015104 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class ModelBuildOptions { /** * @param string $statusCallback The URL we should call using a POST method to * send status information to your application * @param string $uniqueName An application-defined string that uniquely * identifies the new resource * @return CreateModelBuildOptions Options builder */ public static function create(string $statusCallback = Values::NONE, string $uniqueName = Values::NONE): CreateModelBuildOptions { return new CreateModelBuildOptions($statusCallback, $uniqueName); } /** * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return UpdateModelBuildOptions Options builder */ public static function update(string $uniqueName = Values::NONE): UpdateModelBuildOptions { return new UpdateModelBuildOptions($uniqueName); } } class CreateModelBuildOptions extends Options { /** * @param string $statusCallback The URL we should call using a POST method to * send status information to your application * @param string $uniqueName An application-defined string that uniquely * identifies the new resource */ public function __construct(string $statusCallback = Values::NONE, string $uniqueName = Values::NONE) { $this->options['statusCallback'] = $statusCallback; $this->options['uniqueName'] = $uniqueName; } /** * The URL we should call using a POST method to send status information to your application. * * @param string $statusCallback The URL we should call using a POST method to * send status information to your application * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * An application-defined string that uniquely identifies the new resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. * * @param string $uniqueName An application-defined string that uniquely * identifies the new resource * @return $this Fluent Builder */ public function setUniqueName(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.Autopilot.V1.CreateModelBuildOptions ' . $options . ']'; } } class UpdateModelBuildOptions extends Options { /** * @param string $uniqueName An application-defined string that uniquely * identifies the resource */ public function __construct(string $uniqueName = Values::NONE) { $this->options['uniqueName'] = $uniqueName; } /** * An application-defined string that uniquely identifies the resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return $this Fluent Builder */ public function setUniqueName(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.Autopilot.V1.UpdateModelBuildOptions ' . $options . ']'; } } Autopilot/V1/Assistant/FieldTypeInstance.php 0000644 00000011470 15107452347 0015061 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Autopilot\V1\Assistant\FieldType\FieldValueList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property array $links * @property string $assistantSid * @property string $sid * @property string $uniqueName * @property string $url */ class FieldTypeInstance extends InstanceResource { protected $_fieldValues; /** * Initialize the FieldTypeInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The SID of the Assistant that is the parent of * the resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $assistantSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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'), 'links' => Values::array_get($payload, 'links'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['assistantSid' => $assistantSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return FieldTypeContext Context for this FieldTypeInstance */ protected function proxy(): FieldTypeContext { if (!$this->context) { $this->context = new FieldTypeContext( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the FieldTypeInstance * * @return FieldTypeInstance Fetched FieldTypeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FieldTypeInstance { return $this->proxy()->fetch(); } /** * Update the FieldTypeInstance * * @param array|Options $options Optional Arguments * @return FieldTypeInstance Updated FieldTypeInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): FieldTypeInstance { return $this->proxy()->update($options); } /** * Delete the FieldTypeInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Access the fieldValues */ protected function getFieldValues(): FieldValueList { return $this->proxy()->fieldValues; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.FieldTypeInstance ' . \implode(' ', $context) . ']'; } } Autopilot/V1/Assistant/DialogueContext.php 0000644 00000003776 15107452347 0014617 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DialogueContext extends InstanceContext { /** * Initialize the DialogueContext * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the resource to fetch * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $assistantSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, 'sid' => $sid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Dialogues/' . \rawurlencode($sid) . ''; } /** * Fetch the DialogueInstance * * @return DialogueInstance Fetched DialogueInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DialogueInstance { $payload = $this->version->fetch('GET', $this->uri); return new DialogueInstance( $this->version, $payload, $this->solution['assistantSid'], $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.Autopilot.V1.DialogueContext ' . \implode(' ', $context) . ']'; } } Autopilot/V1/Assistant/StyleSheetList.php 0000644 00000002502 15107452347 0014430 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class StyleSheetList extends ListResource { /** * Construct the StyleSheetList * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the resource */ public function __construct(Version $version, string $assistantSid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, ]; } /** * Constructs a StyleSheetContext */ public function getContext(): StyleSheetContext { return new StyleSheetContext($this->version, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Autopilot.V1.StyleSheetList]'; } } Autopilot/V1/Assistant/ModelBuildInstance.php 0000644 00000011264 15107452347 0015215 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $assistantSid * @property string $sid * @property string $status * @property string $uniqueName * @property string $url * @property int $buildDuration * @property int $errorCode */ class ModelBuildInstance extends InstanceResource { /** * Initialize the ModelBuildInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The SID of the Assistant that is the parent of * the resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $assistantSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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')), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'sid' => Values::array_get($payload, 'sid'), 'status' => Values::array_get($payload, 'status'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'url' => Values::array_get($payload, 'url'), 'buildDuration' => Values::array_get($payload, 'build_duration'), 'errorCode' => Values::array_get($payload, 'error_code'), ]; $this->solution = ['assistantSid' => $assistantSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ModelBuildContext Context for this ModelBuildInstance */ protected function proxy(): ModelBuildContext { if (!$this->context) { $this->context = new ModelBuildContext( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the ModelBuildInstance * * @return ModelBuildInstance Fetched ModelBuildInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ModelBuildInstance { return $this->proxy()->fetch(); } /** * Update the ModelBuildInstance * * @param array|Options $options Optional Arguments * @return ModelBuildInstance Updated ModelBuildInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ModelBuildInstance { return $this->proxy()->update($options); } /** * Delete the ModelBuildInstance * * @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.Autopilot.V1.ModelBuildInstance ' . \implode(' ', $context) . ']'; } } Autopilot/V1/Assistant/QueryContext.php 0000644 00000005676 15107452347 0014174 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class QueryContext extends InstanceContext { /** * Initialize the QueryContext * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the resource to fetch * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $assistantSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, 'sid' => $sid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Queries/' . \rawurlencode($sid) . ''; } /** * Fetch the QueryInstance * * @return QueryInstance Fetched QueryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): QueryInstance { $payload = $this->version->fetch('GET', $this->uri); return new QueryInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Update the QueryInstance * * @param array|Options $options Optional Arguments * @return QueryInstance Updated QueryInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): QueryInstance { $options = new Values($options); $data = Values::of(['SampleSid' => $options['sampleSid'], 'Status' => $options['status'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new QueryInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Delete the QueryInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.QueryContext ' . \implode(' ', $context) . ']'; } } Autopilot/V1/Assistant/WebhookList.php 0000644 00000014203 15107452347 0013736 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class WebhookList extends ListResource { /** * Construct the WebhookList * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the resource */ public function __construct(Version $version, string $assistantSid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Webhooks'; } /** * Streams WebhookInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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); } /** * Create the WebhookInstance * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $events The list of space-separated events that this Webhook * will subscribe to. * @param string $webhookUrl The URL associated with this Webhook. * @param array|Options $options Optional Arguments * @return WebhookInstance Created WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $uniqueName, string $events, string $webhookUrl, array $options = []): WebhookInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $uniqueName, 'Events' => $events, 'WebhookUrl' => $webhookUrl, 'WebhookMethod' => $options['webhookMethod'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new WebhookInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Constructs a WebhookContext * * @param string $sid The unique string that identifies the resource to fetch */ public function getContext(string $sid): WebhookContext { return new WebhookContext($this->version, $this->solution['assistantSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Autopilot.V1.WebhookList]'; } } Autopilot/V1/Assistant/StyleSheetContext.php 0000644 00000004726 15107452347 0015153 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class StyleSheetContext extends InstanceContext { /** * Initialize the StyleSheetContext * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant with the StyleSheet * resource to fetch */ public function __construct(Version $version, $assistantSid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/StyleSheet'; } /** * Fetch the StyleSheetInstance * * @return StyleSheetInstance Fetched StyleSheetInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): StyleSheetInstance { $payload = $this->version->fetch('GET', $this->uri); return new StyleSheetInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Update the StyleSheetInstance * * @param array|Options $options Optional Arguments * @return StyleSheetInstance Updated StyleSheetInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): StyleSheetInstance { $options = new Values($options); $data = Values::of(['StyleSheet' => Serialize::jsonObject($options['styleSheet']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new StyleSheetInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.StyleSheetContext ' . \implode(' ', $context) . ']'; } } Autopilot/V1/Assistant/TaskContext.php 0000644 00000014775 15107452347 0013771 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Autopilot\V1\Assistant\Task\FieldList; use Twilio\Rest\Autopilot\V1\Assistant\Task\SampleList; use Twilio\Rest\Autopilot\V1\Assistant\Task\TaskActionsList; use Twilio\Rest\Autopilot\V1\Assistant\Task\TaskStatisticsList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property FieldList $fields * @property SampleList $samples * @property TaskActionsList $taskActions * @property TaskStatisticsList $statistics * @method \Twilio\Rest\Autopilot\V1\Assistant\Task\FieldContext fields(string $sid) * @method \Twilio\Rest\Autopilot\V1\Assistant\Task\SampleContext samples(string $sid) * @method \Twilio\Rest\Autopilot\V1\Assistant\Task\TaskActionsContext taskActions() * @method \Twilio\Rest\Autopilot\V1\Assistant\Task\TaskStatisticsContext statistics() */ class TaskContext extends InstanceContext { protected $_fields; protected $_samples; protected $_taskActions; protected $_statistics; /** * Initialize the TaskContext * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the resource to fetch * @param string $sid The unique string that identifies the resource to fetch */ public function __construct(Version $version, $assistantSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, 'sid' => $sid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Tasks/' . \rawurlencode($sid) . ''; } /** * Fetch the TaskInstance * * @return TaskInstance Fetched TaskInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TaskInstance { $payload = $this->version->fetch('GET', $this->uri); return new TaskInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Update the TaskInstance * * @param array|Options $options Optional Arguments * @return TaskInstance Updated TaskInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): TaskInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'Actions' => Serialize::jsonObject($options['actions']), 'ActionsUrl' => $options['actionsUrl'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new TaskInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Delete the TaskInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Access the fields */ protected function getFields(): FieldList { if (!$this->_fields) { $this->_fields = new FieldList( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->_fields; } /** * Access the samples */ protected function getSamples(): SampleList { if (!$this->_samples) { $this->_samples = new SampleList( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->_samples; } /** * Access the taskActions */ protected function getTaskActions(): TaskActionsList { if (!$this->_taskActions) { $this->_taskActions = new TaskActionsList( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->_taskActions; } /** * Access the statistics */ protected function getStatistics(): TaskStatisticsList { if (!$this->_statistics) { $this->_statistics = new TaskStatisticsList( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->_statistics; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return 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.Autopilot.V1.TaskContext ' . \implode(' ', $context) . ']'; } } Autopilot/V1/Assistant/Task/TaskActionsContext.php 0000644 00000005640 15107452347 0016203 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\Task; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class TaskActionsContext extends InstanceContext { /** * Initialize the TaskActionsContext * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the Task for which the task actions to fetch * were defined * @param string $taskSid The SID of the Task for which the task actions to * fetch were defined */ public function __construct(Version $version, $assistantSid, $taskSid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, 'taskSid' => $taskSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Tasks/' . \rawurlencode($taskSid) . '/Actions'; } /** * Fetch the TaskActionsInstance * * @return TaskActionsInstance Fetched TaskActionsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TaskActionsInstance { $payload = $this->version->fetch('GET', $this->uri); return new TaskActionsInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Update the TaskActionsInstance * * @param array|Options $options Optional Arguments * @return TaskActionsInstance Updated TaskActionsInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): TaskActionsInstance { $options = new Values($options); $data = Values::of(['Actions' => Serialize::jsonObject($options['actions']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new TaskActionsInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.TaskActionsContext ' . \implode(' ', $context) . ']'; } } Autopilot/V1/Assistant/Task/TaskStatisticsPage.php 0000644 00000003014 15107452347 0016156 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\Task; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class TaskStatisticsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return TaskStatisticsInstance \Twilio\Rest\Autopilot\V1\Assistant\Task\TaskStatisticsInstance */ public function buildInstance(array $payload): TaskStatisticsInstance { return new TaskStatisticsInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Autopilot.V1.TaskStatisticsPage]'; } } Autopilot/V1/Assistant/Task/SampleInstance.php 0000644 00000011550 15107452347 0015316 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\Task; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $taskSid * @property string $language * @property string $assistantSid * @property string $sid * @property string $taggedText * @property string $url * @property string $sourceChannel */ class SampleInstance extends InstanceResource { /** * Initialize the SampleInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The SID of the Assistant that is the parent of * the Task associated with the resource * @param string $taskSid The SID of the Task associated with the resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $assistantSid, string $taskSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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')), 'taskSid' => Values::array_get($payload, 'task_sid'), 'language' => Values::array_get($payload, 'language'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'sid' => Values::array_get($payload, 'sid'), 'taggedText' => Values::array_get($payload, 'tagged_text'), 'url' => Values::array_get($payload, 'url'), 'sourceChannel' => Values::array_get($payload, 'source_channel'), ]; $this->solution = [ 'assistantSid' => $assistantSid, 'taskSid' => $taskSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SampleContext Context for this SampleInstance */ protected function proxy(): SampleContext { if (!$this->context) { $this->context = new SampleContext( $this->version, $this->solution['assistantSid'], $this->solution['taskSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the SampleInstance * * @return SampleInstance Fetched SampleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SampleInstance { return $this->proxy()->fetch(); } /** * Update the SampleInstance * * @param array|Options $options Optional Arguments * @return SampleInstance Updated SampleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SampleInstance { return $this->proxy()->update($options); } /** * Delete the SampleInstance * * @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.Autopilot.V1.SampleInstance ' . \implode(' ', $context) . ']'; } } Autopilot/V1/Assistant/Task/TaskActionsList.php 0000644 00000003047 15107452347 0015471 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\Task; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class TaskActionsList extends ListResource { /** * Construct the TaskActionsList * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the Task associated with the resource * @param string $taskSid The SID of the Task associated with the resource */ public function __construct(Version $version, string $assistantSid, string $taskSid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, 'taskSid' => $taskSid, ]; } /** * Constructs a TaskActionsContext */ public function getContext(): TaskActionsContext { return new TaskActionsContext( $this->version, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Autopilot.V1.TaskActionsList]'; } } Autopilot/V1/Assistant/Task/TaskStatisticsContext.php 0000644 00000004203 15107452347 0016727 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\Task; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class TaskStatisticsContext extends InstanceContext { /** * Initialize the TaskStatisticsContext * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the resource to fetch * @param string $taskSid The SID of the Task that is associated with the * resource to fetch */ public function __construct(Version $version, $assistantSid, $taskSid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, 'taskSid' => $taskSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Tasks/' . \rawurlencode($taskSid) . '/Statistics'; } /** * Fetch the TaskStatisticsInstance * * @return TaskStatisticsInstance Fetched TaskStatisticsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TaskStatisticsInstance { $payload = $this->version->fetch('GET', $this->uri); return new TaskStatisticsInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.TaskStatisticsContext ' . \implode(' ', $context) . ']'; } } Autopilot/V1/Assistant/Task/SampleContext.php 0000644 00000006540 15107452347 0015201 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\Task; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SampleContext extends InstanceContext { /** * Initialize the SampleContext * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the Task associated with the resource to fetch * @param string $taskSid The SID of the Task associated with the Sample * resource to create * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $assistantSid, $taskSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, 'taskSid' => $taskSid, 'sid' => $sid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Tasks/' . \rawurlencode($taskSid) . '/Samples/' . \rawurlencode($sid) . ''; } /** * Fetch the SampleInstance * * @return SampleInstance Fetched SampleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SampleInstance { $payload = $this->version->fetch('GET', $this->uri); return new SampleInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'], $this->solution['sid'] ); } /** * Update the SampleInstance * * @param array|Options $options Optional Arguments * @return SampleInstance Updated SampleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SampleInstance { $options = new Values($options); $data = Values::of([ 'Language' => $options['language'], 'TaggedText' => $options['taggedText'], 'SourceChannel' => $options['sourceChannel'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SampleInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'], $this->solution['sid'] ); } /** * Delete the SampleInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.SampleContext ' . \implode(' ', $context) . ']'; } } Autopilot/V1/Assistant/Task/SampleList.php 0000644 00000015321 15107452347 0014465 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\Task; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SampleList extends ListResource { /** * Construct the SampleList * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the Task associated with the resource * @param string $taskSid The SID of the Task associated with the resource */ public function __construct(Version $version, string $assistantSid, string $taskSid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, 'taskSid' => $taskSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Tasks/' . \rawurlencode($taskSid) . '/Samples'; } /** * Streams SampleInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * Reads SampleInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SampleInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of SampleInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SamplePage Page of SampleInstance */ public function page(array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): SamplePage { $options = new Values($options); $params = Values::of([ 'Language' => $options['language'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SamplePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SampleInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SamplePage Page of SampleInstance */ public function getPage(string $targetUrl): SamplePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SamplePage($this->version, $response, $this->solution); } /** * Create the SampleInstance * * @param string $language The ISO language-country string that specifies the * language used for the new sample * @param string $taggedText The text example of how end users might express * the task * @param array|Options $options Optional Arguments * @return SampleInstance Created SampleInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $language, string $taggedText, array $options = []): SampleInstance { $options = new Values($options); $data = Values::of([ 'Language' => $language, 'TaggedText' => $taggedText, 'SourceChannel' => $options['sourceChannel'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SampleInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Constructs a SampleContext * * @param string $sid The unique string that identifies the resource */ public function getContext(string $sid): SampleContext { return new SampleContext( $this->version, $this->solution['assistantSid'], $this->solution['taskSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Autopilot.V1.SampleList]'; } } Autopilot/V1/Assistant/Task/FieldPage.php 0000644 00000002726 15107452347 0014235 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\Task; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FieldPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return FieldInstance \Twilio\Rest\Autopilot\V1\Assistant\Task\FieldInstance */ public function buildInstance(array $payload): FieldInstance { return new FieldInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Autopilot.V1.FieldPage]'; } } Autopilot/V1/Assistant/Task/FieldInstance.php 0000644 00000010731 15107452347 0015120 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\Task; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $fieldType * @property string $taskSid * @property string $assistantSid * @property string $sid * @property string $uniqueName * @property string $url */ class FieldInstance extends InstanceResource { /** * Initialize the FieldInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The SID of the Assistant that is the parent of * the Task associated with the resource * @param string $taskSid The SID of the * [Task](https://www.twilio.com/docs/autopilot/api/task) resource associated with this Field * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $assistantSid, string $taskSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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')), 'fieldType' => Values::array_get($payload, 'field_type'), 'taskSid' => Values::array_get($payload, 'task_sid'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = [ 'assistantSid' => $assistantSid, 'taskSid' => $taskSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return FieldContext Context for this FieldInstance */ protected function proxy(): FieldContext { if (!$this->context) { $this->context = new FieldContext( $this->version, $this->solution['assistantSid'], $this->solution['taskSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the FieldInstance * * @return FieldInstance Fetched FieldInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FieldInstance { return $this->proxy()->fetch(); } /** * Delete the FieldInstance * * @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.Autopilot.V1.FieldInstance ' . \implode(' ', $context) . ']'; } } Autopilot/V1/Assistant/Task/SamplePage.php 0000644 00000002734 15107452347 0014432 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\Task; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SamplePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SampleInstance \Twilio\Rest\Autopilot\V1\Assistant\Task\SampleInstance */ public function buildInstance(array $payload): SampleInstance { return new SampleInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Autopilot.V1.SamplePage]'; } } Autopilot/V1/Assistant/Task/FieldList.php 0000644 00000014144 15107452347 0014271 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\Task; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FieldList extends ListResource { /** * Construct the FieldList * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the Task associated with the resource * @param string $taskSid The SID of the * [Task](https://www.twilio.com/docs/autopilot/api/task) resource associated with this Field */ public function __construct(Version $version, string $assistantSid, string $taskSid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, 'taskSid' => $taskSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Tasks/' . \rawurlencode($taskSid) . '/Fields'; } /** * Streams FieldInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * Reads FieldInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FieldInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of FieldInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return FieldPage Page of FieldInstance */ public function page($pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): FieldPage { $params = Values::of(['PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new FieldPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FieldInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return FieldPage Page of FieldInstance */ public function getPage(string $targetUrl): FieldPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FieldPage($this->version, $response, $this->solution); } /** * Create the FieldInstance * * @param string $fieldType The Field Type of this field * @param string $uniqueName An application-defined string that uniquely * identifies the new resource * @return FieldInstance Created FieldInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $fieldType, string $uniqueName): FieldInstance { $data = Values::of(['FieldType' => $fieldType, 'UniqueName' => $uniqueName, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new FieldInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Constructs a FieldContext * * @param string $sid The unique string that identifies the resource */ public function getContext(string $sid): FieldContext { return new FieldContext( $this->version, $this->solution['assistantSid'], $this->solution['taskSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Autopilot.V1.FieldList]'; } } Autopilot/V1/Assistant/Task/TaskActionsInstance.php 0000644 00000007570 15107452347 0016327 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\Task; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $assistantSid * @property string $taskSid * @property string $url * @property array $data */ class TaskActionsInstance extends InstanceResource { /** * Initialize the TaskActionsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The SID of the Assistant that is the parent of * the Task associated with the resource * @param string $taskSid The SID of the Task associated with the resource */ public function __construct(Version $version, array $payload, string $assistantSid, string $taskSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'taskSid' => Values::array_get($payload, 'task_sid'), 'url' => Values::array_get($payload, 'url'), 'data' => Values::array_get($payload, 'data'), ]; $this->solution = ['assistantSid' => $assistantSid, 'taskSid' => $taskSid, ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return TaskActionsContext Context for this TaskActionsInstance */ protected function proxy(): TaskActionsContext { if (!$this->context) { $this->context = new TaskActionsContext( $this->version, $this->solution['assistantSid'], $this->solution['taskSid'] ); } return $this->context; } /** * Fetch the TaskActionsInstance * * @return TaskActionsInstance Fetched TaskActionsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TaskActionsInstance { return $this->proxy()->fetch(); } /** * Update the TaskActionsInstance * * @param array|Options $options Optional Arguments * @return TaskActionsInstance Updated TaskActionsInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): TaskActionsInstance { 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.Autopilot.V1.TaskActionsInstance ' . \implode(' ', $context) . ']'; } } Autopilot/V1/Assistant/Task/TaskActionsPage.php 0000644 00000002772 15107452347 0015436 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\Task; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class TaskActionsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return TaskActionsInstance \Twilio\Rest\Autopilot\V1\Assistant\Task\TaskActionsInstance */ public function buildInstance(array $payload): TaskActionsInstance { return new TaskActionsInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Autopilot.V1.TaskActionsPage]'; } } Autopilot/V1/Assistant/Task/SampleOptions.php 0000644 00000015244 15107452347 0015211 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\Task; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class SampleOptions { /** * @param string $language The ISO language-country string that specifies the * language used for the sample * @return ReadSampleOptions Options builder */ public static function read(string $language = Values::NONE): ReadSampleOptions { return new ReadSampleOptions($language); } /** * @param string $sourceChannel The communication channel from which the new * sample was captured * @return CreateSampleOptions Options builder */ public static function create(string $sourceChannel = Values::NONE): CreateSampleOptions { return new CreateSampleOptions($sourceChannel); } /** * @param string $language The ISO language-country string that specifies the * language used for the sample * @param string $taggedText The text example of how end users might express * the task * @param string $sourceChannel The communication channel from which the sample * was captured * @return UpdateSampleOptions Options builder */ public static function update(string $language = Values::NONE, string $taggedText = Values::NONE, string $sourceChannel = Values::NONE): UpdateSampleOptions { return new UpdateSampleOptions($language, $taggedText, $sourceChannel); } } class ReadSampleOptions extends Options { /** * @param string $language The ISO language-country string that specifies the * language used for the sample */ public function __construct(string $language = Values::NONE) { $this->options['language'] = $language; } /** * The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. * * @param string $language The ISO language-country string that specifies the * language used for the sample * @return $this Fluent Builder */ public function setLanguage(string $language): self { $this->options['language'] = $language; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Autopilot.V1.ReadSampleOptions ' . $options . ']'; } } class CreateSampleOptions extends Options { /** * @param string $sourceChannel The communication channel from which the new * sample was captured */ public function __construct(string $sourceChannel = Values::NONE) { $this->options['sourceChannel'] = $sourceChannel; } /** * The communication channel from which the new sample was captured. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. * * @param string $sourceChannel The communication channel from which the new * sample was captured * @return $this Fluent Builder */ public function setSourceChannel(string $sourceChannel): self { $this->options['sourceChannel'] = $sourceChannel; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Autopilot.V1.CreateSampleOptions ' . $options . ']'; } } class UpdateSampleOptions extends Options { /** * @param string $language The ISO language-country string that specifies the * language used for the sample * @param string $taggedText The text example of how end users might express * the task * @param string $sourceChannel The communication channel from which the sample * was captured */ public function __construct(string $language = Values::NONE, string $taggedText = Values::NONE, string $sourceChannel = Values::NONE) { $this->options['language'] = $language; $this->options['taggedText'] = $taggedText; $this->options['sourceChannel'] = $sourceChannel; } /** * The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. * * @param string $language The ISO language-country string that specifies the * language used for the sample * @return $this Fluent Builder */ public function setLanguage(string $language): self { $this->options['language'] = $language; return $this; } /** * The text example of how end users might express the task. The sample can contain [Field tag blocks](https://www.twilio.com/docs/autopilot/api/task-sample#field-tagging). * * @param string $taggedText The text example of how end users might express * the task * @return $this Fluent Builder */ public function setTaggedText(string $taggedText): self { $this->options['taggedText'] = $taggedText; return $this; } /** * The communication channel from which the sample was captured. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. * * @param string $sourceChannel The communication channel from which the sample * was captured * @return $this Fluent Builder */ public function setSourceChannel(string $sourceChannel): self { $this->options['sourceChannel'] = $sourceChannel; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Autopilot.V1.UpdateSampleOptions ' . $options . ']'; } } Autopilot/V1/Assistant/Task/FieldContext.php 0000644 00000005076 15107452347 0015006 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\Task; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FieldContext extends InstanceContext { /** * Initialize the FieldContext * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the Task associated with the resource to fetch * @param string $taskSid The SID of the * [Task](https://www.twilio.com/docs/autopilot/api/task) resource associated with the Field resource to fetch * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $assistantSid, $taskSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, 'taskSid' => $taskSid, 'sid' => $sid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Tasks/' . \rawurlencode($taskSid) . '/Fields/' . \rawurlencode($sid) . ''; } /** * Fetch the FieldInstance * * @return FieldInstance Fetched FieldInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FieldInstance { $payload = $this->version->fetch('GET', $this->uri); return new FieldInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'], $this->solution['sid'] ); } /** * Delete the FieldInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.FieldContext ' . \implode(' ', $context) . ']'; } } Autopilot/V1/Assistant/Task/TaskStatisticsInstance.php 0000644 00000007300 15107452347 0017050 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\Task; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $assistantSid * @property string $taskSid * @property int $samplesCount * @property int $fieldsCount * @property string $url */ class TaskStatisticsInstance extends InstanceResource { /** * Initialize the TaskStatisticsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The SID of the Assistant that is the parent of * the Task associated with the resource * @param string $taskSid The SID of the Task for which the statistics were * collected */ public function __construct(Version $version, array $payload, string $assistantSid, string $taskSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'taskSid' => Values::array_get($payload, 'task_sid'), 'samplesCount' => Values::array_get($payload, 'samples_count'), 'fieldsCount' => Values::array_get($payload, 'fields_count'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['assistantSid' => $assistantSid, 'taskSid' => $taskSid, ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return TaskStatisticsContext Context for this TaskStatisticsInstance */ protected function proxy(): TaskStatisticsContext { if (!$this->context) { $this->context = new TaskStatisticsContext( $this->version, $this->solution['assistantSid'], $this->solution['taskSid'] ); } return $this->context; } /** * Fetch the TaskStatisticsInstance * * @return TaskStatisticsInstance Fetched TaskStatisticsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TaskStatisticsInstance { 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.Autopilot.V1.TaskStatisticsInstance ' . \implode(' ', $context) . ']'; } } Autopilot/V1/Assistant/Task/TaskStatisticsList.php 0000644 00000003142 15107452347 0016217 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\Task; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class TaskStatisticsList extends ListResource { /** * Construct the TaskStatisticsList * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the Task associated with the resource * @param string $taskSid The SID of the Task for which the statistics were * collected */ public function __construct(Version $version, string $assistantSid, string $taskSid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, 'taskSid' => $taskSid, ]; } /** * Constructs a TaskStatisticsContext */ public function getContext(): TaskStatisticsContext { return new TaskStatisticsContext( $this->version, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Autopilot.V1.TaskStatisticsList]'; } } Autopilot/V1/Assistant/Task/TaskActionsOptions.php 0000644 00000003731 15107452347 0016211 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\Task; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class TaskActionsOptions { /** * @param array $actions The JSON string that specifies the actions that * instruct the Assistant on how to perform the task * @return UpdateTaskActionsOptions Options builder */ public static function update(array $actions = Values::ARRAY_NONE): UpdateTaskActionsOptions { return new UpdateTaskActionsOptions($actions); } } class UpdateTaskActionsOptions extends Options { /** * @param array $actions The JSON string that specifies the actions that * instruct the Assistant on how to perform the task */ public function __construct(array $actions = Values::ARRAY_NONE) { $this->options['actions'] = $actions; } /** * The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. * * @param array $actions The JSON string that specifies the actions that * instruct the Assistant on how to perform the task * @return $this Fluent Builder */ public function setActions(array $actions): self { $this->options['actions'] = $actions; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Autopilot.V1.UpdateTaskActionsOptions ' . $options . ']'; } } Autopilot/V1/Assistant/ModelBuildList.php 0000644 00000013401 15107452347 0014357 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ModelBuildList extends ListResource { /** * Construct the ModelBuildList * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the resource */ public function __construct(Version $version, string $assistantSid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/ModelBuilds'; } /** * Streams ModelBuildInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * Reads ModelBuildInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ModelBuildInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of ModelBuildInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ModelBuildPage Page of ModelBuildInstance */ public function page($pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): ModelBuildPage { $params = Values::of(['PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ModelBuildPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ModelBuildInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ModelBuildPage Page of ModelBuildInstance */ public function getPage(string $targetUrl): ModelBuildPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ModelBuildPage($this->version, $response, $this->solution); } /** * Create the ModelBuildInstance * * @param array|Options $options Optional Arguments * @return ModelBuildInstance Created ModelBuildInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): ModelBuildInstance { $options = new Values($options); $data = Values::of([ 'StatusCallback' => $options['statusCallback'], 'UniqueName' => $options['uniqueName'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ModelBuildInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Constructs a ModelBuildContext * * @param string $sid The unique string that identifies the resource */ public function getContext(string $sid): ModelBuildContext { return new ModelBuildContext($this->version, $this->solution['assistantSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Autopilot.V1.ModelBuildList]'; } } Autopilot/V1/Assistant/DefaultsList.php 0000644 00000002466 15107452347 0014117 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DefaultsList extends ListResource { /** * Construct the DefaultsList * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the resource */ public function __construct(Version $version, string $assistantSid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, ]; } /** * Constructs a DefaultsContext */ public function getContext(): DefaultsContext { return new DefaultsContext($this->version, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Autopilot.V1.DefaultsList]'; } } Autopilot/V1/Assistant/DefaultsInstance.php 0000644 00000006775 15107452347 0014757 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $assistantSid * @property string $url * @property array $data */ class DefaultsInstance extends InstanceResource { /** * Initialize the DefaultsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The SID of the Assistant that is the parent of * the resource */ public function __construct(Version $version, array $payload, string $assistantSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'url' => Values::array_get($payload, 'url'), 'data' => Values::array_get($payload, 'data'), ]; $this->solution = ['assistantSid' => $assistantSid, ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return DefaultsContext Context for this DefaultsInstance */ protected function proxy(): DefaultsContext { if (!$this->context) { $this->context = new DefaultsContext($this->version, $this->solution['assistantSid']); } return $this->context; } /** * Fetch the DefaultsInstance * * @return DefaultsInstance Fetched DefaultsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DefaultsInstance { return $this->proxy()->fetch(); } /** * Update the DefaultsInstance * * @param array|Options $options Optional Arguments * @return DefaultsInstance Updated DefaultsInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): DefaultsInstance { 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.Autopilot.V1.DefaultsInstance ' . \implode(' ', $context) . ']'; } } Autopilot/V1/Assistant/StyleSheetInstance.php 0000644 00000007033 15107452347 0015265 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $assistantSid * @property string $url * @property array $data */ class StyleSheetInstance extends InstanceResource { /** * Initialize the StyleSheetInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The SID of the Assistant that is the parent of * the resource */ public function __construct(Version $version, array $payload, string $assistantSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'url' => Values::array_get($payload, 'url'), 'data' => Values::array_get($payload, 'data'), ]; $this->solution = ['assistantSid' => $assistantSid, ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return StyleSheetContext Context for this StyleSheetInstance */ protected function proxy(): StyleSheetContext { if (!$this->context) { $this->context = new StyleSheetContext($this->version, $this->solution['assistantSid']); } return $this->context; } /** * Fetch the StyleSheetInstance * * @return StyleSheetInstance Fetched StyleSheetInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): StyleSheetInstance { return $this->proxy()->fetch(); } /** * Update the StyleSheetInstance * * @param array|Options $options Optional Arguments * @return StyleSheetInstance Updated StyleSheetInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): StyleSheetInstance { 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.Autopilot.V1.StyleSheetInstance ' . \implode(' ', $context) . ']'; } } Autopilot/V1/Assistant/FieldTypePage.php 0000644 00000002616 15107452347 0014173 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FieldTypePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return FieldTypeInstance \Twilio\Rest\Autopilot\V1\Assistant\FieldTypeInstance */ public function buildInstance(array $payload): FieldTypeInstance { return new FieldTypeInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Autopilot.V1.FieldTypePage]'; } } Autopilot/V1/Assistant/DialoguePage.php 0000644 00000002610 15107452347 0014031 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DialoguePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return DialogueInstance \Twilio\Rest\Autopilot\V1\Assistant\DialogueInstance */ public function buildInstance(array $payload): DialogueInstance { return new DialogueInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Autopilot.V1.DialoguePage]'; } } Autopilot/V1/Assistant/QueryList.php 0000644 00000014703 15107452347 0013452 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class QueryList extends ListResource { /** * Construct the QueryList * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the resource */ public function __construct(Version $version, string $assistantSid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Queries'; } /** * Streams QueryInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * Reads QueryInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return QueryInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of QueryInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return QueryPage Page of QueryInstance */ public function page(array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): QueryPage { $options = new Values($options); $params = Values::of([ 'Language' => $options['language'], 'ModelBuild' => $options['modelBuild'], 'Status' => $options['status'], 'DialogueSid' => $options['dialogueSid'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new QueryPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of QueryInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return QueryPage Page of QueryInstance */ public function getPage(string $targetUrl): QueryPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new QueryPage($this->version, $response, $this->solution); } /** * Create the QueryInstance * * @param string $language The ISO language-country string that specifies the * language used for the new query * @param string $query The end-user's natural language input * @param array|Options $options Optional Arguments * @return QueryInstance Created QueryInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $language, string $query, array $options = []): QueryInstance { $options = new Values($options); $data = Values::of([ 'Language' => $language, 'Query' => $query, 'Tasks' => $options['tasks'], 'ModelBuild' => $options['modelBuild'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new QueryInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Constructs a QueryContext * * @param string $sid The unique string that identifies the resource */ public function getContext(string $sid): QueryContext { return new QueryContext($this->version, $this->solution['assistantSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Autopilot.V1.QueryList]'; } } Autopilot/V1/Assistant/QueryInstance.php 0000644 00000011765 15107452347 0014310 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property array $results * @property string $language * @property string $modelBuildSid * @property string $query * @property string $sampleSid * @property string $assistantSid * @property string $sid * @property string $status * @property string $url * @property string $sourceChannel * @property string $dialogueSid */ class QueryInstance extends InstanceResource { /** * Initialize the QueryInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The SID of the Assistant that is the parent of * the resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $assistantSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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')), 'results' => Values::array_get($payload, 'results'), 'language' => Values::array_get($payload, 'language'), 'modelBuildSid' => Values::array_get($payload, 'model_build_sid'), 'query' => Values::array_get($payload, 'query'), 'sampleSid' => Values::array_get($payload, 'sample_sid'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'sid' => Values::array_get($payload, 'sid'), 'status' => Values::array_get($payload, 'status'), 'url' => Values::array_get($payload, 'url'), 'sourceChannel' => Values::array_get($payload, 'source_channel'), 'dialogueSid' => Values::array_get($payload, 'dialogue_sid'), ]; $this->solution = ['assistantSid' => $assistantSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return QueryContext Context for this QueryInstance */ protected function proxy(): QueryContext { if (!$this->context) { $this->context = new QueryContext( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the QueryInstance * * @return QueryInstance Fetched QueryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): QueryInstance { return $this->proxy()->fetch(); } /** * Update the QueryInstance * * @param array|Options $options Optional Arguments * @return QueryInstance Updated QueryInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): QueryInstance { return $this->proxy()->update($options); } /** * Delete the QueryInstance * * @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.Autopilot.V1.QueryInstance ' . \implode(' ', $context) . ']'; } } Autopilot/V1/Assistant/QueryPage.php 0000644 00000002566 15107452347 0013417 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class QueryPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return QueryInstance \Twilio\Rest\Autopilot\V1\Assistant\QueryInstance */ public function buildInstance(array $payload): QueryInstance { return new QueryInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Autopilot.V1.QueryPage]'; } } Autopilot/V1/Assistant/DefaultsPage.php 0000644 00000002610 15107452347 0014047 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DefaultsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return DefaultsInstance \Twilio\Rest\Autopilot\V1\Assistant\DefaultsInstance */ public function buildInstance(array $payload): DefaultsInstance { return new DefaultsInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Autopilot.V1.DefaultsPage]'; } } Autopilot/V1/Assistant/TaskInstance.php 0000644 00000013000 15107452347 0014065 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Autopilot\V1\Assistant\Task\FieldList; use Twilio\Rest\Autopilot\V1\Assistant\Task\SampleList; use Twilio\Rest\Autopilot\V1\Assistant\Task\TaskActionsList; use Twilio\Rest\Autopilot\V1\Assistant\Task\TaskStatisticsList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property array $links * @property string $assistantSid * @property string $sid * @property string $uniqueName * @property string $actionsUrl * @property string $url */ class TaskInstance extends InstanceResource { protected $_fields; protected $_samples; protected $_taskActions; protected $_statistics; /** * Initialize the TaskInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The SID of the Assistant that is the parent of * the resource * @param string $sid The unique string that identifies the resource to fetch */ public function __construct(Version $version, array $payload, string $assistantSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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'), 'links' => Values::array_get($payload, 'links'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'actionsUrl' => Values::array_get($payload, 'actions_url'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['assistantSid' => $assistantSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return TaskContext Context for this TaskInstance */ protected function proxy(): TaskContext { if (!$this->context) { $this->context = new TaskContext( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->context; } /** * 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); } /** * Delete the TaskInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Access the fields */ protected function getFields(): FieldList { return $this->proxy()->fields; } /** * Access the samples */ protected function getSamples(): SampleList { return $this->proxy()->samples; } /** * Access the taskActions */ protected function getTaskActions(): TaskActionsList { return $this->proxy()->taskActions; } /** * Access the statistics */ protected function getStatistics(): TaskStatisticsList { 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.Autopilot.V1.TaskInstance ' . \implode(' ', $context) . ']'; } }Autopilot/V1/Assistant/WebhookContext.php 0000644 00000006165 15107452347 0014457 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class WebhookContext extends InstanceContext { /** * Initialize the WebhookContext * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the resource to fetch * @param string $sid The unique string that identifies the resource to fetch */ public function __construct(Version $version, $assistantSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, 'sid' => $sid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Webhooks/' . \rawurlencode($sid) . ''; } /** * Fetch the WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WebhookInstance { $payload = $this->version->fetch('GET', $this->uri); return new WebhookInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): WebhookInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $options['uniqueName'], 'Events' => $options['events'], 'WebhookUrl' => $options['webhookUrl'], 'WebhookMethod' => $options['webhookMethod'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new WebhookInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Delete the WebhookInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.WebhookContext ' . \implode(' ', $context) . ']'; } } Autopilot/V1/Assistant/FieldTypeContext.php 0000644 00000011424 15107452347 0014740 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Autopilot\V1\Assistant\FieldType\FieldValueList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property FieldValueList $fieldValues * @method \Twilio\Rest\Autopilot\V1\Assistant\FieldType\FieldValueContext fieldValues(string $sid) */ class FieldTypeContext extends InstanceContext { protected $_fieldValues; /** * Initialize the FieldTypeContext * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the resource to fetch * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $assistantSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, 'sid' => $sid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/FieldTypes/' . \rawurlencode($sid) . ''; } /** * Fetch the FieldTypeInstance * * @return FieldTypeInstance Fetched FieldTypeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FieldTypeInstance { $payload = $this->version->fetch('GET', $this->uri); return new FieldTypeInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Update the FieldTypeInstance * * @param array|Options $options Optional Arguments * @return FieldTypeInstance Updated FieldTypeInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): FieldTypeInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new FieldTypeInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Delete the FieldTypeInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Access the fieldValues */ protected function getFieldValues(): FieldValueList { if (!$this->_fieldValues) { $this->_fieldValues = new FieldValueList( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->_fieldValues; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return 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.Autopilot.V1.FieldTypeContext ' . \implode(' ', $context) . ']'; } } Autopilot/V1/Assistant/DialogueList.php 0000644 00000002627 15107452347 0014100 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DialogueList extends ListResource { /** * Construct the DialogueList * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the resource */ public function __construct(Version $version, string $assistantSid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, ]; } /** * Constructs a DialogueContext * * @param string $sid The unique string that identifies the resource */ public function getContext(string $sid): DialogueContext { return new DialogueContext($this->version, $this->solution['assistantSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Autopilot.V1.DialogueList]'; } } Autopilot/V1/Assistant/ModelBuildPage.php 0000644 00000002624 15107452347 0014325 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ModelBuildPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ModelBuildInstance \Twilio\Rest\Autopilot\V1\Assistant\ModelBuildInstance */ public function buildInstance(array $payload): ModelBuildInstance { return new ModelBuildInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Autopilot.V1.ModelBuildPage]'; } } Autopilot/V1/Assistant/TaskOptions.php 0000644 00000016274 15107452347 0013774 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class TaskOptions { /** * @param string $friendlyName descriptive string that you create to describe * the new resource * @param array $actions The JSON string that specifies the actions that * instruct the Assistant on how to perform the task * @param string $actionsUrl The URL from which the Assistant can fetch actions * @return CreateTaskOptions Options builder */ public static function create(string $friendlyName = Values::NONE, array $actions = Values::ARRAY_NONE, string $actionsUrl = Values::NONE): CreateTaskOptions { return new CreateTaskOptions($friendlyName, $actions, $actionsUrl); } /** * @param string $friendlyName A string to describe the resource * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param array $actions The JSON string that specifies the actions that * instruct the Assistant on how to perform the task * @param string $actionsUrl The URL from which the Assistant can fetch actions * @return UpdateTaskOptions Options builder */ public static function update(string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, array $actions = Values::ARRAY_NONE, string $actionsUrl = Values::NONE): UpdateTaskOptions { return new UpdateTaskOptions($friendlyName, $uniqueName, $actions, $actionsUrl); } } class CreateTaskOptions extends Options { /** * @param string $friendlyName descriptive string that you create to describe * the new resource * @param array $actions The JSON string that specifies the actions that * instruct the Assistant on how to perform the task * @param string $actionsUrl The URL from which the Assistant can fetch actions */ public function __construct(string $friendlyName = Values::NONE, array $actions = Values::ARRAY_NONE, string $actionsUrl = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['actions'] = $actions; $this->options['actionsUrl'] = $actionsUrl; } /** * A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. * * @param string $friendlyName descriptive string that you create to describe * the new resource * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. It is optional and not unique. * * @param array $actions The JSON string that specifies the actions that * instruct the Assistant on how to perform the task * @return $this Fluent Builder */ public function setActions(array $actions): self { $this->options['actions'] = $actions; return $this; } /** * The URL from which the Assistant can fetch actions. * * @param string $actionsUrl The URL from which the Assistant can fetch actions * @return $this Fluent Builder */ public function setActionsUrl(string $actionsUrl): self { $this->options['actionsUrl'] = $actionsUrl; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Autopilot.V1.CreateTaskOptions ' . $options . ']'; } } class UpdateTaskOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param array $actions The JSON string that specifies the actions that * instruct the Assistant on how to perform the task * @param string $actionsUrl The URL from which the Assistant can fetch actions */ public function __construct(string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, array $actions = Values::ARRAY_NONE, string $actionsUrl = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['actions'] = $actions; $this->options['actionsUrl'] = $actionsUrl; } /** * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * An application-defined string that uniquely identifies the resource. This value must be 64 characters or less in length and be unique. It can be used as an alternative to the `sid` in the URL path to address the resource. * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. * * @param array $actions The JSON string that specifies the actions that * instruct the Assistant on how to perform the task * @return $this Fluent Builder */ public function setActions(array $actions): self { $this->options['actions'] = $actions; return $this; } /** * The URL from which the Assistant can fetch actions. * * @param string $actionsUrl The URL from which the Assistant can fetch actions * @return $this Fluent Builder */ public function setActionsUrl(string $actionsUrl): self { $this->options['actionsUrl'] = $actionsUrl; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Autopilot.V1.UpdateTaskOptions ' . $options . ']'; } } Autopilot/V1/Assistant/FieldTypeList.php 0000644 00000013526 15107452347 0014234 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FieldTypeList extends ListResource { /** * Construct the FieldTypeList * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the resource */ public function __construct(Version $version, string $assistantSid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/FieldTypes'; } /** * Streams FieldTypeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * Reads FieldTypeInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FieldTypeInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of FieldTypeInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return FieldTypePage Page of FieldTypeInstance */ public function page($pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): FieldTypePage { $params = Values::of(['PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new FieldTypePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FieldTypeInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return FieldTypePage Page of FieldTypeInstance */ public function getPage(string $targetUrl): FieldTypePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FieldTypePage($this->version, $response, $this->solution); } /** * Create the FieldTypeInstance * * @param string $uniqueName An application-defined string that uniquely * identifies the new resource * @param array|Options $options Optional Arguments * @return FieldTypeInstance Created FieldTypeInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $uniqueName, array $options = []): FieldTypeInstance { $options = new Values($options); $data = Values::of(['UniqueName' => $uniqueName, 'FriendlyName' => $options['friendlyName'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new FieldTypeInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Constructs a FieldTypeContext * * @param string $sid The unique string that identifies the resource */ public function getContext(string $sid): FieldTypeContext { return new FieldTypeContext($this->version, $this->solution['assistantSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Autopilot.V1.FieldTypeList]'; } } Autopilot/V1/Assistant/QueryOptions.php 0000644 00000020470 15107452347 0014170 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class QueryOptions { /** * @param string $language The ISO language-country string that specifies the * language used by the Query resources to read * @param string $modelBuild The SID or unique name of the Model Build to be * queried * @param string $status The status of the resources to read * @param string $dialogueSid The SID of the * [Dialogue](https://www.twilio.com/docs/autopilot/api/dialogue). * @return ReadQueryOptions Options builder */ public static function read(string $language = Values::NONE, string $modelBuild = Values::NONE, string $status = Values::NONE, string $dialogueSid = Values::NONE): ReadQueryOptions { return new ReadQueryOptions($language, $modelBuild, $status, $dialogueSid); } /** * @param string $tasks The list of tasks to limit the new query to * @param string $modelBuild The SID or unique name of the Model Build to be * queried * @return CreateQueryOptions Options builder */ public static function create(string $tasks = Values::NONE, string $modelBuild = Values::NONE): CreateQueryOptions { return new CreateQueryOptions($tasks, $modelBuild); } /** * @param string $sampleSid The SID of an optional reference to the Sample * created from the query * @param string $status The new status of the resource * @return UpdateQueryOptions Options builder */ public static function update(string $sampleSid = Values::NONE, string $status = Values::NONE): UpdateQueryOptions { return new UpdateQueryOptions($sampleSid, $status); } } class ReadQueryOptions extends Options { /** * @param string $language The ISO language-country string that specifies the * language used by the Query resources to read * @param string $modelBuild The SID or unique name of the Model Build to be * queried * @param string $status The status of the resources to read * @param string $dialogueSid The SID of the * [Dialogue](https://www.twilio.com/docs/autopilot/api/dialogue). */ public function __construct(string $language = Values::NONE, string $modelBuild = Values::NONE, string $status = Values::NONE, string $dialogueSid = Values::NONE) { $this->options['language'] = $language; $this->options['modelBuild'] = $modelBuild; $this->options['status'] = $status; $this->options['dialogueSid'] = $dialogueSid; } /** * The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used by the Query resources to read. For example: `en-US`. * * @param string $language The ISO language-country string that specifies the * language used by the Query resources to read * @return $this Fluent Builder */ public function setLanguage(string $language): self { $this->options['language'] = $language; return $this; } /** * The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. * * @param string $modelBuild The SID or unique name of the Model Build to be * queried * @return $this Fluent Builder */ public function setModelBuild(string $modelBuild): self { $this->options['modelBuild'] = $modelBuild; return $this; } /** * The status of the resources to read. Can be: `pending-review`, `reviewed`, or `discarded` * * @param string $status The status of the resources to read * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * The SID of the [Dialogue](https://www.twilio.com/docs/autopilot/api/dialogue). * * @param string $dialogueSid The SID of the * [Dialogue](https://www.twilio.com/docs/autopilot/api/dialogue). * @return $this Fluent Builder */ public function setDialogueSid(string $dialogueSid): self { $this->options['dialogueSid'] = $dialogueSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Autopilot.V1.ReadQueryOptions ' . $options . ']'; } } class CreateQueryOptions extends Options { /** * @param string $tasks The list of tasks to limit the new query to * @param string $modelBuild The SID or unique name of the Model Build to be * queried */ public function __construct(string $tasks = Values::NONE, string $modelBuild = Values::NONE) { $this->options['tasks'] = $tasks; $this->options['modelBuild'] = $modelBuild; } /** * The list of tasks to limit the new query to. Tasks are expressed as a comma-separated list of task `unique_name` values. For example, `task-unique_name-1, task-unique_name-2`. Listing specific tasks is useful to constrain the paths that a user can take. * * @param string $tasks The list of tasks to limit the new query to * @return $this Fluent Builder */ public function setTasks(string $tasks): self { $this->options['tasks'] = $tasks; return $this; } /** * The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. * * @param string $modelBuild The SID or unique name of the Model Build to be * queried * @return $this Fluent Builder */ public function setModelBuild(string $modelBuild): self { $this->options['modelBuild'] = $modelBuild; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Autopilot.V1.CreateQueryOptions ' . $options . ']'; } } class UpdateQueryOptions extends Options { /** * @param string $sampleSid The SID of an optional reference to the Sample * created from the query * @param string $status The new status of the resource */ public function __construct(string $sampleSid = Values::NONE, string $status = Values::NONE) { $this->options['sampleSid'] = $sampleSid; $this->options['status'] = $status; } /** * The SID of an optional reference to the [Sample](https://www.twilio.com/docs/autopilot/api/task-sample) created from the query. * * @param string $sampleSid The SID of an optional reference to the Sample * created from the query * @return $this Fluent Builder */ public function setSampleSid(string $sampleSid): self { $this->options['sampleSid'] = $sampleSid; return $this; } /** * The new status of the resource. Can be: `pending-review`, `reviewed`, or `discarded` * * @param string $status The new status of the resource * @return $this Fluent Builder */ public function setStatus(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.Autopilot.V1.UpdateQueryOptions ' . $options . ']'; } } Autopilot/V1/Assistant/FieldType/FieldValueOptions.php 0000644 00000006506 15107452347 0016774 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\FieldType; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class FieldValueOptions { /** * @param string $language The ISO language-country tag that identifies the * language of the value * @return ReadFieldValueOptions Options builder */ public static function read(string $language = Values::NONE): ReadFieldValueOptions { return new ReadFieldValueOptions($language); } /** * @param string $synonymOf The string value that indicates which word the * field value is a synonym of * @return CreateFieldValueOptions Options builder */ public static function create(string $synonymOf = Values::NONE): CreateFieldValueOptions { return new CreateFieldValueOptions($synonymOf); } } class ReadFieldValueOptions extends Options { /** * @param string $language The ISO language-country tag that identifies the * language of the value */ public function __construct(string $language = Values::NONE) { $this->options['language'] = $language; } /** * The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `en-US` * * @param string $language The ISO language-country tag that identifies the * language of the value * @return $this Fluent Builder */ public function setLanguage(string $language): self { $this->options['language'] = $language; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Autopilot.V1.ReadFieldValueOptions ' . $options . ']'; } } class CreateFieldValueOptions extends Options { /** * @param string $synonymOf The string value that indicates which word the * field value is a synonym of */ public function __construct(string $synonymOf = Values::NONE) { $this->options['synonymOf'] = $synonymOf; } /** * The string value that indicates which word the field value is a synonym of. * * @param string $synonymOf The string value that indicates which word the * field value is a synonym of * @return $this Fluent Builder */ public function setSynonymOf(string $synonymOf): self { $this->options['synonymOf'] = $synonymOf; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Autopilot.V1.CreateFieldValueOptions ' . $options . ']'; } } Autopilot/V1/Assistant/FieldType/FieldValueInstance.php 0000644 00000011156 15107452347 0017102 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\FieldType; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $fieldTypeSid * @property string $language * @property string $assistantSid * @property string $sid * @property string $value * @property string $url * @property string $synonymOf */ class FieldValueInstance extends InstanceResource { /** * Initialize the FieldValueInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The SID of the Assistant that is the parent of * the FieldType associated with the resource * @param string $fieldTypeSid The SID of the Field Type associated with the * Field Value * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $assistantSid, string $fieldTypeSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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')), 'fieldTypeSid' => Values::array_get($payload, 'field_type_sid'), 'language' => Values::array_get($payload, 'language'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'sid' => Values::array_get($payload, 'sid'), 'value' => Values::array_get($payload, 'value'), 'url' => Values::array_get($payload, 'url'), 'synonymOf' => Values::array_get($payload, 'synonym_of'), ]; $this->solution = [ 'assistantSid' => $assistantSid, 'fieldTypeSid' => $fieldTypeSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return FieldValueContext Context for this FieldValueInstance */ protected function proxy(): FieldValueContext { if (!$this->context) { $this->context = new FieldValueContext( $this->version, $this->solution['assistantSid'], $this->solution['fieldTypeSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the FieldValueInstance * * @return FieldValueInstance Fetched FieldValueInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FieldValueInstance { return $this->proxy()->fetch(); } /** * Delete the FieldValueInstance * * @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.Autopilot.V1.FieldValueInstance ' . \implode(' ', $context) . ']'; } } Autopilot/V1/Assistant/FieldType/FieldValueContext.php 0000644 00000005216 15107452347 0016762 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\FieldType; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FieldValueContext extends InstanceContext { /** * Initialize the FieldValueContext * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the FieldType associated with the resource to * fetch * @param string $fieldTypeSid The SID of the Field Type associated with the * Field Value to fetch * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $assistantSid, $fieldTypeSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, 'fieldTypeSid' => $fieldTypeSid, 'sid' => $sid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/FieldTypes/' . \rawurlencode($fieldTypeSid) . '/FieldValues/' . \rawurlencode($sid) . ''; } /** * Fetch the FieldValueInstance * * @return FieldValueInstance Fetched FieldValueInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FieldValueInstance { $payload = $this->version->fetch('GET', $this->uri); return new FieldValueInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['fieldTypeSid'], $this->solution['sid'] ); } /** * Delete the FieldValueInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.FieldValueContext ' . \implode(' ', $context) . ']'; } } Autopilot/V1/Assistant/FieldType/FieldValuePage.php 0000644 00000003003 15107452347 0016202 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\FieldType; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FieldValuePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return FieldValueInstance \Twilio\Rest\Autopilot\V1\Assistant\FieldType\FieldValueInstance */ public function buildInstance(array $payload): FieldValueInstance { return new FieldValueInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['fieldTypeSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Autopilot.V1.FieldValuePage]'; } } Autopilot/V1/Assistant/FieldType/FieldValueList.php 0000644 00000015445 15107452347 0016256 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\FieldType; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FieldValueList extends ListResource { /** * Construct the FieldValueList * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the FieldType associated with the resource * @param string $fieldTypeSid The SID of the Field Type associated with the * Field Value */ public function __construct(Version $version, string $assistantSid, string $fieldTypeSid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, 'fieldTypeSid' => $fieldTypeSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/FieldTypes/' . \rawurlencode($fieldTypeSid) . '/FieldValues'; } /** * Streams FieldValueInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * Reads FieldValueInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FieldValueInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of FieldValueInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return FieldValuePage Page of FieldValueInstance */ public function page(array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): FieldValuePage { $options = new Values($options); $params = Values::of([ 'Language' => $options['language'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new FieldValuePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FieldValueInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return FieldValuePage Page of FieldValueInstance */ public function getPage(string $targetUrl): FieldValuePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FieldValuePage($this->version, $response, $this->solution); } /** * Create the FieldValueInstance * * @param string $language The ISO language-country tag that identifies the * language of the value * @param string $value The Field Value data * @param array|Options $options Optional Arguments * @return FieldValueInstance Created FieldValueInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $language, string $value, array $options = []): FieldValueInstance { $options = new Values($options); $data = Values::of([ 'Language' => $language, 'Value' => $value, 'SynonymOf' => $options['synonymOf'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new FieldValueInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['fieldTypeSid'] ); } /** * Constructs a FieldValueContext * * @param string $sid The unique string that identifies the resource */ public function getContext(string $sid): FieldValueContext { return new FieldValueContext( $this->version, $this->solution['assistantSid'], $this->solution['fieldTypeSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Autopilot.V1.FieldValueList]'; } } Autopilot/V1/Assistant/DialogueInstance.php 0000644 00000006670 15107452347 0014733 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $assistantSid * @property string $sid * @property array $data * @property string $url */ class DialogueInstance extends InstanceResource { /** * Initialize the DialogueInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The SID of the Assistant that is the parent of * the resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $assistantSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'sid' => Values::array_get($payload, 'sid'), 'data' => Values::array_get($payload, 'data'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['assistantSid' => $assistantSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return DialogueContext Context for this DialogueInstance */ protected function proxy(): DialogueContext { if (!$this->context) { $this->context = new DialogueContext( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the DialogueInstance * * @return DialogueInstance Fetched DialogueInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DialogueInstance { 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.Autopilot.V1.DialogueInstance ' . \implode(' ', $context) . ']'; } } Autopilot/V1/Assistant/TaskList.php 0000644 00000013616 15107452347 0013251 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class TaskList extends ListResource { /** * Construct the TaskList * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the resource */ public function __construct(Version $version, string $assistantSid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Tasks'; } /** * Streams TaskInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * Reads TaskInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TaskInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of TaskInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return TaskPage Page of TaskInstance */ public function page($pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): TaskPage { $params = Values::of(['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); } /** * Create the TaskInstance * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param array|Options $options Optional Arguments * @return TaskInstance Created TaskInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $uniqueName, array $options = []): TaskInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $uniqueName, 'FriendlyName' => $options['friendlyName'], 'Actions' => Serialize::jsonObject($options['actions']), 'ActionsUrl' => $options['actionsUrl'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new TaskInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Constructs a TaskContext * * @param string $sid The unique string that identifies the resource to fetch */ public function getContext(string $sid): TaskContext { return new TaskContext($this->version, $this->solution['assistantSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Autopilot.V1.TaskList]'; } } Autopilot/V1/Assistant/DefaultsContext.php 0000644 00000004674 15107452347 0014633 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DefaultsContext extends InstanceContext { /** * Initialize the DefaultsContext * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the resource to fetch */ public function __construct(Version $version, $assistantSid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Defaults'; } /** * Fetch the DefaultsInstance * * @return DefaultsInstance Fetched DefaultsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DefaultsInstance { $payload = $this->version->fetch('GET', $this->uri); return new DefaultsInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Update the DefaultsInstance * * @param array|Options $options Optional Arguments * @return DefaultsInstance Updated DefaultsInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): DefaultsInstance { $options = new Values($options); $data = Values::of(['Defaults' => Serialize::jsonObject($options['defaults']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new DefaultsInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.DefaultsContext ' . \implode(' ', $context) . ']'; } } Autopilot/V1/Assistant/StyleSheetOptions.php 0000644 00000003432 15107452347 0015153 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class StyleSheetOptions { /** * @param array $styleSheet The JSON string that describes the style sheet * object * @return UpdateStyleSheetOptions Options builder */ public static function update(array $styleSheet = Values::ARRAY_NONE): UpdateStyleSheetOptions { return new UpdateStyleSheetOptions($styleSheet); } } class UpdateStyleSheetOptions extends Options { /** * @param array $styleSheet The JSON string that describes the style sheet * object */ public function __construct(array $styleSheet = Values::ARRAY_NONE) { $this->options['styleSheet'] = $styleSheet; } /** * The JSON string that describes the style sheet object. * * @param array $styleSheet The JSON string that describes the style sheet * object * @return $this Fluent Builder */ public function setStyleSheet(array $styleSheet): self { $this->options['styleSheet'] = $styleSheet; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Autopilot.V1.UpdateStyleSheetOptions ' . $options . ']'; } } Autopilot/V1/Assistant/StyleSheetPage.php 0000644 00000002624 15107452347 0014376 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class StyleSheetPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return StyleSheetInstance \Twilio\Rest\Autopilot\V1\Assistant\StyleSheetInstance */ public function buildInstance(array $payload): StyleSheetInstance { return new StyleSheetInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Autopilot.V1.StyleSheetPage]'; } } Autopilot/V1/Assistant/ModelBuildContext.php 0000644 00000005752 15107452347 0015102 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ModelBuildContext extends InstanceContext { /** * Initialize the ModelBuildContext * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the resource to fetch * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $assistantSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, 'sid' => $sid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/ModelBuilds/' . \rawurlencode($sid) . ''; } /** * Fetch the ModelBuildInstance * * @return ModelBuildInstance Fetched ModelBuildInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ModelBuildInstance { $payload = $this->version->fetch('GET', $this->uri); return new ModelBuildInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Update the ModelBuildInstance * * @param array|Options $options Optional Arguments * @return ModelBuildInstance Updated ModelBuildInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ModelBuildInstance { $options = new Values($options); $data = Values::of(['UniqueName' => $options['uniqueName'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ModelBuildInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Delete the ModelBuildInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.ModelBuildContext ' . \implode(' ', $context) . ']'; } } Autopilot/V1/Assistant/FieldTypeOptions.php 0000644 00000007627 15107452347 0014761 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class FieldTypeOptions { /** * @param string $friendlyName A string to describe the new resource * @return CreateFieldTypeOptions Options builder */ public static function create(string $friendlyName = Values::NONE): CreateFieldTypeOptions { return new CreateFieldTypeOptions($friendlyName); } /** * @param string $friendlyName A string to describe the resource * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return UpdateFieldTypeOptions Options builder */ public static function update(string $friendlyName = Values::NONE, string $uniqueName = Values::NONE): UpdateFieldTypeOptions { return new UpdateFieldTypeOptions($friendlyName, $uniqueName); } } class CreateFieldTypeOptions extends Options { /** * @param string $friendlyName A string to describe the new resource */ public function __construct(string $friendlyName = Values::NONE) { $this->options['friendlyName'] = $friendlyName; } /** * A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. * * @param string $friendlyName A string to describe the new resource * @return $this Fluent Builder */ public function setFriendlyName(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.Autopilot.V1.CreateFieldTypeOptions ' . $options . ']'; } } class UpdateFieldTypeOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $uniqueName An application-defined string that uniquely * identifies the resource */ public function __construct(string $friendlyName = Values::NONE, string $uniqueName = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; } /** * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return $this Fluent Builder */ public function setUniqueName(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.Autopilot.V1.UpdateFieldTypeOptions ' . $options . ']'; } } Autopilot/V1/Assistant/WebhookInstance.php 0000644 00000011226 15107452347 0014571 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $url * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $assistantSid * @property string $sid * @property string $uniqueName * @property string $events * @property string $webhookUrl * @property string $webhookMethod */ class WebhookInstance extends InstanceResource { /** * Initialize the WebhookInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The SID of the Assistant that is the parent of * the resource * @param string $sid The unique string that identifies the resource to fetch */ public function __construct(Version $version, array $payload, string $assistantSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'url' => Values::array_get($payload, 'url'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'events' => Values::array_get($payload, 'events'), 'webhookUrl' => Values::array_get($payload, 'webhook_url'), 'webhookMethod' => Values::array_get($payload, 'webhook_method'), ]; $this->solution = ['assistantSid' => $assistantSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return WebhookContext Context for this WebhookInstance */ protected function proxy(): WebhookContext { if (!$this->context) { $this->context = new WebhookContext( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.WebhookInstance ' . \implode(' ', $context) . ']'; } } Autopilot/V1/Assistant/WebhookOptions.php 0000644 00000012711 15107452347 0014460 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class WebhookOptions { /** * @param string $webhookMethod The method to be used when calling the * webhook's URL. * @return CreateWebhookOptions Options builder */ public static function create(string $webhookMethod = Values::NONE): CreateWebhookOptions { return new CreateWebhookOptions($webhookMethod); } /** * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $events The list of space-separated events that this Webhook * will subscribe to. * @param string $webhookUrl The URL associated with this Webhook. * @param string $webhookMethod The method to be used when calling the * webhook's URL. * @return UpdateWebhookOptions Options builder */ public static function update(string $uniqueName = Values::NONE, string $events = Values::NONE, string $webhookUrl = Values::NONE, string $webhookMethod = Values::NONE): UpdateWebhookOptions { return new UpdateWebhookOptions($uniqueName, $events, $webhookUrl, $webhookMethod); } } class CreateWebhookOptions extends Options { /** * @param string $webhookMethod The method to be used when calling the * webhook's URL. */ public function __construct(string $webhookMethod = Values::NONE) { $this->options['webhookMethod'] = $webhookMethod; } /** * The method to be used when calling the webhook's URL. * * @param string $webhookMethod The method to be used when calling the * webhook's URL. * @return $this Fluent Builder */ public function setWebhookMethod(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.Autopilot.V1.CreateWebhookOptions ' . $options . ']'; } } class UpdateWebhookOptions extends Options { /** * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $events The list of space-separated events that this Webhook * will subscribe to. * @param string $webhookUrl The URL associated with this Webhook. * @param string $webhookMethod The method to be used when calling the * webhook's URL. */ public function __construct(string $uniqueName = Values::NONE, string $events = Values::NONE, string $webhookUrl = Values::NONE, string $webhookMethod = Values::NONE) { $this->options['uniqueName'] = $uniqueName; $this->options['events'] = $events; $this->options['webhookUrl'] = $webhookUrl; $this->options['webhookMethod'] = $webhookMethod; } /** * An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The list of space-separated events that this Webhook will subscribe to. * * @param string $events The list of space-separated events that this Webhook * will subscribe to. * @return $this Fluent Builder */ public function setEvents(string $events): self { $this->options['events'] = $events; return $this; } /** * The URL associated with this Webhook. * * @param string $webhookUrl The URL associated with this Webhook. * @return $this Fluent Builder */ public function setWebhookUrl(string $webhookUrl): self { $this->options['webhookUrl'] = $webhookUrl; return $this; } /** * The method to be used when calling the webhook's URL. * * @param string $webhookMethod The method to be used when calling the * webhook's URL. * @return $this Fluent Builder */ public function setWebhookMethod(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.Autopilot.V1.UpdateWebhookOptions ' . $options . ']'; } } Autopilot/V1/Assistant/TaskPage.php 0000644 00000002560 15107452347 0013206 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class TaskPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return TaskInstance \Twilio\Rest\Autopilot\V1\Assistant\TaskInstance */ public function buildInstance(array $payload): TaskInstance { return new TaskInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Autopilot.V1.TaskPage]'; } } Autopilot/V1/Assistant/DefaultsOptions.php 0000644 00000003326 15107452347 0014633 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class DefaultsOptions { /** * @param array $defaults A JSON string that describes the default task links. * @return UpdateDefaultsOptions Options builder */ public static function update(array $defaults = Values::ARRAY_NONE): UpdateDefaultsOptions { return new UpdateDefaultsOptions($defaults); } } class UpdateDefaultsOptions extends Options { /** * @param array $defaults A JSON string that describes the default task links. */ public function __construct(array $defaults = Values::ARRAY_NONE) { $this->options['defaults'] = $defaults; } /** * A JSON string that describes the default task links for the `assistant_initiation`, `collect`, and `fallback` situations. * * @param array $defaults A JSON string that describes the default task links. * @return $this Fluent Builder */ public function setDefaults(array $defaults): self { $this->options['defaults'] = $defaults; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Autopilot.V1.UpdateDefaultsOptions ' . $options . ']'; } } Autopilot/V1/AssistantList.php 0000644 00000013431 15107452347 0012342 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AssistantList extends ListResource { /** * Construct the AssistantList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Assistants'; } /** * Streams AssistantInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * Reads AssistantInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AssistantInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of AssistantInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AssistantPage Page of AssistantInstance */ public function page($pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): AssistantPage { $params = Values::of(['PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AssistantPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AssistantInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AssistantPage Page of AssistantInstance */ public function getPage(string $targetUrl): AssistantPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AssistantPage($this->version, $response, $this->solution); } /** * Create the AssistantInstance * * @param array|Options $options Optional Arguments * @return AssistantInstance Created AssistantInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): AssistantInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'LogQueries' => Serialize::booleanToString($options['logQueries']), 'UniqueName' => $options['uniqueName'], 'CallbackUrl' => $options['callbackUrl'], 'CallbackEvents' => $options['callbackEvents'], 'StyleSheet' => Serialize::jsonObject($options['styleSheet']), 'Defaults' => Serialize::jsonObject($options['defaults']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AssistantInstance($this->version, $payload); } /** * Constructs a AssistantContext * * @param string $sid The unique string that identifies the resource */ public function getContext(string $sid): AssistantContext { return new AssistantContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Autopilot.V1.AssistantList]'; } } Autopilot/V1/AssistantContext.php 0000644 00000017514 15107452350 0013053 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Autopilot\V1\Assistant\DefaultsList; use Twilio\Rest\Autopilot\V1\Assistant\DialogueList; use Twilio\Rest\Autopilot\V1\Assistant\FieldTypeList; use Twilio\Rest\Autopilot\V1\Assistant\ModelBuildList; use Twilio\Rest\Autopilot\V1\Assistant\QueryList; use Twilio\Rest\Autopilot\V1\Assistant\StyleSheetList; use Twilio\Rest\Autopilot\V1\Assistant\TaskList; use Twilio\Rest\Autopilot\V1\Assistant\WebhookList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property FieldTypeList $fieldTypes * @property TaskList $tasks * @property ModelBuildList $modelBuilds * @property QueryList $queries * @property StyleSheetList $styleSheet * @property DefaultsList $defaults * @property DialogueList $dialogues * @property WebhookList $webhooks * @method \Twilio\Rest\Autopilot\V1\Assistant\FieldTypeContext fieldTypes(string $sid) * @method \Twilio\Rest\Autopilot\V1\Assistant\TaskContext tasks(string $sid) * @method \Twilio\Rest\Autopilot\V1\Assistant\ModelBuildContext modelBuilds(string $sid) * @method \Twilio\Rest\Autopilot\V1\Assistant\QueryContext queries(string $sid) * @method \Twilio\Rest\Autopilot\V1\Assistant\StyleSheetContext styleSheet() * @method \Twilio\Rest\Autopilot\V1\Assistant\DefaultsContext defaults() * @method \Twilio\Rest\Autopilot\V1\Assistant\DialogueContext dialogues(string $sid) * @method \Twilio\Rest\Autopilot\V1\Assistant\WebhookContext webhooks(string $sid) */ class AssistantContext extends InstanceContext { protected $_fieldTypes; protected $_tasks; protected $_modelBuilds; protected $_queries; protected $_styleSheet; protected $_defaults; protected $_dialogues; protected $_webhooks; /** * Initialize the AssistantContext * * @param Version $version Version that contains the resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Assistants/' . \rawurlencode($sid) . ''; } /** * Fetch the AssistantInstance * * @return AssistantInstance Fetched AssistantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AssistantInstance { $payload = $this->version->fetch('GET', $this->uri); return new AssistantInstance($this->version, $payload, $this->solution['sid']); } /** * Update the AssistantInstance * * @param array|Options $options Optional Arguments * @return AssistantInstance Updated AssistantInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): AssistantInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'LogQueries' => Serialize::booleanToString($options['logQueries']), 'UniqueName' => $options['uniqueName'], 'CallbackUrl' => $options['callbackUrl'], 'CallbackEvents' => $options['callbackEvents'], 'StyleSheet' => Serialize::jsonObject($options['styleSheet']), 'Defaults' => Serialize::jsonObject($options['defaults']), 'DevelopmentStage' => $options['developmentStage'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new AssistantInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the AssistantInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Access the fieldTypes */ protected function getFieldTypes(): FieldTypeList { if (!$this->_fieldTypes) { $this->_fieldTypes = new FieldTypeList($this->version, $this->solution['sid']); } return $this->_fieldTypes; } /** * Access the tasks */ protected function getTasks(): TaskList { if (!$this->_tasks) { $this->_tasks = new TaskList($this->version, $this->solution['sid']); } return $this->_tasks; } /** * Access the modelBuilds */ protected function getModelBuilds(): ModelBuildList { if (!$this->_modelBuilds) { $this->_modelBuilds = new ModelBuildList($this->version, $this->solution['sid']); } return $this->_modelBuilds; } /** * Access the queries */ protected function getQueries(): QueryList { if (!$this->_queries) { $this->_queries = new QueryList($this->version, $this->solution['sid']); } return $this->_queries; } /** * Access the styleSheet */ protected function getStyleSheet(): StyleSheetList { if (!$this->_styleSheet) { $this->_styleSheet = new StyleSheetList($this->version, $this->solution['sid']); } return $this->_styleSheet; } /** * Access the defaults */ protected function getDefaults(): DefaultsList { if (!$this->_defaults) { $this->_defaults = new DefaultsList($this->version, $this->solution['sid']); } return $this->_defaults; } /** * Access the dialogues */ protected function getDialogues(): DialogueList { if (!$this->_dialogues) { $this->_dialogues = new DialogueList($this->version, $this->solution['sid']); } return $this->_dialogues; } /** * Access the webhooks */ protected function getWebhooks(): WebhookList { if (!$this->_webhooks) { $this->_webhooks = new WebhookList($this->version, $this->solution['sid']); } return $this->_webhooks; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return 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.Autopilot.V1.AssistantContext ' . \implode(' ', $context) . ']'; } } Autopilot/V1/RestoreAssistantInstance.php 0000644 00000006102 15107452350 0014526 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $sid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $uniqueName * @property string $friendlyName * @property bool $needsModelBuild * @property string $latestModelBuildSid * @property bool $logQueries * @property string $developmentStage * @property string $callbackUrl * @property string $callbackEvents */ class RestoreAssistantInstance extends InstanceResource { /** * Initialize the RestoreAssistantInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->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')), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'needsModelBuild' => Values::array_get($payload, 'needs_model_build'), 'latestModelBuildSid' => Values::array_get($payload, 'latest_model_build_sid'), 'logQueries' => Values::array_get($payload, 'log_queries'), 'developmentStage' => Values::array_get($payload, 'development_stage'), 'callbackUrl' => Values::array_get($payload, 'callback_url'), 'callbackEvents' => Values::array_get($payload, 'callback_events'), ]; $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.Autopilot.V1.RestoreAssistantInstance]'; } } Autopilot/V1/AssistantInstance.php 0000644 00000015153 15107452350 0013170 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Autopilot\V1\Assistant\DefaultsList; use Twilio\Rest\Autopilot\V1\Assistant\DialogueList; use Twilio\Rest\Autopilot\V1\Assistant\FieldTypeList; use Twilio\Rest\Autopilot\V1\Assistant\ModelBuildList; use Twilio\Rest\Autopilot\V1\Assistant\QueryList; use Twilio\Rest\Autopilot\V1\Assistant\StyleSheetList; use Twilio\Rest\Autopilot\V1\Assistant\TaskList; use Twilio\Rest\Autopilot\V1\Assistant\WebhookList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $latestModelBuildSid * @property array $links * @property bool $logQueries * @property string $developmentStage * @property bool $needsModelBuild * @property string $sid * @property string $uniqueName * @property string $url * @property string $callbackUrl * @property string $callbackEvents */ class AssistantInstance extends InstanceResource { protected $_fieldTypes; protected $_tasks; protected $_modelBuilds; protected $_queries; protected $_styleSheet; protected $_defaults; protected $_dialogues; protected $_webhooks; /** * Initialize the AssistantInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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'), 'latestModelBuildSid' => Values::array_get($payload, 'latest_model_build_sid'), 'links' => Values::array_get($payload, 'links'), 'logQueries' => Values::array_get($payload, 'log_queries'), 'developmentStage' => Values::array_get($payload, 'development_stage'), 'needsModelBuild' => Values::array_get($payload, 'needs_model_build'), 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'url' => Values::array_get($payload, 'url'), 'callbackUrl' => Values::array_get($payload, 'callback_url'), 'callbackEvents' => Values::array_get($payload, 'callback_events'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AssistantContext Context for this AssistantInstance */ protected function proxy(): AssistantContext { if (!$this->context) { $this->context = new AssistantContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch the AssistantInstance * * @return AssistantInstance Fetched AssistantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AssistantInstance { return $this->proxy()->fetch(); } /** * Update the AssistantInstance * * @param array|Options $options Optional Arguments * @return AssistantInstance Updated AssistantInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): AssistantInstance { return $this->proxy()->update($options); } /** * Delete the AssistantInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Access the fieldTypes */ protected function getFieldTypes(): FieldTypeList { return $this->proxy()->fieldTypes; } /** * Access the tasks */ protected function getTasks(): TaskList { return $this->proxy()->tasks; } /** * Access the modelBuilds */ protected function getModelBuilds(): ModelBuildList { return $this->proxy()->modelBuilds; } /** * Access the queries */ protected function getQueries(): QueryList { return $this->proxy()->queries; } /** * Access the styleSheet */ protected function getStyleSheet(): StyleSheetList { return $this->proxy()->styleSheet; } /** * Access the defaults */ protected function getDefaults(): DefaultsList { return $this->proxy()->defaults; } /** * Access the dialogues */ protected function getDialogues(): DialogueList { return $this->proxy()->dialogues; } /** * Access the webhooks */ protected function getWebhooks(): WebhookList { return $this->proxy()->webhooks; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.AssistantInstance ' . \implode(' ', $context) . ']'; } } Autopilot/V1/AssistantOptions.php 0000644 00000032045 15107452350 0013056 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class AssistantOptions { /** * @param string $friendlyName A string to describe the new resource * @param bool $logQueries Whether queries should be logged and kept after * training * @param string $uniqueName An application-defined string that uniquely * identifies the new resource * @param string $callbackUrl Reserved * @param string $callbackEvents Reserved * @param array $styleSheet A JSON string that defines the Assistant's style * sheet * @param array $defaults A JSON object that defines the Assistant's default * tasks for various scenarios * @return CreateAssistantOptions Options builder */ public static function create(string $friendlyName = Values::NONE, bool $logQueries = Values::NONE, string $uniqueName = Values::NONE, string $callbackUrl = Values::NONE, string $callbackEvents = Values::NONE, array $styleSheet = Values::ARRAY_NONE, array $defaults = Values::ARRAY_NONE): CreateAssistantOptions { return new CreateAssistantOptions($friendlyName, $logQueries, $uniqueName, $callbackUrl, $callbackEvents, $styleSheet, $defaults); } /** * @param string $friendlyName A string to describe the resource * @param bool $logQueries Whether queries should be logged and kept after * training * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $callbackUrl Reserved * @param string $callbackEvents Reserved * @param array $styleSheet A JSON string that defines the Assistant's style * sheet * @param array $defaults A JSON object that defines the Assistant's [default * tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios * @param string $developmentStage A string describing the state of the * assistant. * @return UpdateAssistantOptions Options builder */ public static function update(string $friendlyName = Values::NONE, bool $logQueries = Values::NONE, string $uniqueName = Values::NONE, string $callbackUrl = Values::NONE, string $callbackEvents = Values::NONE, array $styleSheet = Values::ARRAY_NONE, array $defaults = Values::ARRAY_NONE, string $developmentStage = Values::NONE): UpdateAssistantOptions { return new UpdateAssistantOptions($friendlyName, $logQueries, $uniqueName, $callbackUrl, $callbackEvents, $styleSheet, $defaults, $developmentStage); } } class CreateAssistantOptions extends Options { /** * @param string $friendlyName A string to describe the new resource * @param bool $logQueries Whether queries should be logged and kept after * training * @param string $uniqueName An application-defined string that uniquely * identifies the new resource * @param string $callbackUrl Reserved * @param string $callbackEvents Reserved * @param array $styleSheet A JSON string that defines the Assistant's style * sheet * @param array $defaults A JSON object that defines the Assistant's default * tasks for various scenarios */ public function __construct(string $friendlyName = Values::NONE, bool $logQueries = Values::NONE, string $uniqueName = Values::NONE, string $callbackUrl = Values::NONE, string $callbackEvents = Values::NONE, array $styleSheet = Values::ARRAY_NONE, array $defaults = Values::ARRAY_NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['logQueries'] = $logQueries; $this->options['uniqueName'] = $uniqueName; $this->options['callbackUrl'] = $callbackUrl; $this->options['callbackEvents'] = $callbackEvents; $this->options['styleSheet'] = $styleSheet; $this->options['defaults'] = $defaults; } /** * A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. * * @param string $friendlyName A string to describe the new resource * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. * * @param bool $logQueries Whether queries should be logged and kept after * training * @return $this Fluent Builder */ public function setLogQueries(bool $logQueries): self { $this->options['logQueries'] = $logQueries; return $this; } /** * An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. * * @param string $uniqueName An application-defined string that uniquely * identifies the new resource * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Reserved. * * @param string $callbackUrl Reserved * @return $this Fluent Builder */ public function setCallbackUrl(string $callbackUrl): self { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * Reserved. * * @param string $callbackEvents Reserved * @return $this Fluent Builder */ public function setCallbackEvents(string $callbackEvents): self { $this->options['callbackEvents'] = $callbackEvents; return $this; } /** * The JSON string that defines the Assistant's [style sheet](https://www.twilio.com/docs/autopilot/api/assistant/stylesheet) * * @param array $styleSheet A JSON string that defines the Assistant's style * sheet * @return $this Fluent Builder */ public function setStyleSheet(array $styleSheet): self { $this->options['styleSheet'] = $styleSheet; return $this; } /** * A JSON object that defines the Assistant's [default tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios, including initiation actions and fallback tasks. * * @param array $defaults A JSON object that defines the Assistant's default * tasks for various scenarios * @return $this Fluent Builder */ public function setDefaults(array $defaults): self { $this->options['defaults'] = $defaults; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Autopilot.V1.CreateAssistantOptions ' . $options . ']'; } } class UpdateAssistantOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param bool $logQueries Whether queries should be logged and kept after * training * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $callbackUrl Reserved * @param string $callbackEvents Reserved * @param array $styleSheet A JSON string that defines the Assistant's style * sheet * @param array $defaults A JSON object that defines the Assistant's [default * tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios * @param string $developmentStage A string describing the state of the * assistant. */ public function __construct(string $friendlyName = Values::NONE, bool $logQueries = Values::NONE, string $uniqueName = Values::NONE, string $callbackUrl = Values::NONE, string $callbackEvents = Values::NONE, array $styleSheet = Values::ARRAY_NONE, array $defaults = Values::ARRAY_NONE, string $developmentStage = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['logQueries'] = $logQueries; $this->options['uniqueName'] = $uniqueName; $this->options['callbackUrl'] = $callbackUrl; $this->options['callbackEvents'] = $callbackEvents; $this->options['styleSheet'] = $styleSheet; $this->options['defaults'] = $defaults; $this->options['developmentStage'] = $developmentStage; } /** * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. * * @param bool $logQueries Whether queries should be logged and kept after * training * @return $this Fluent Builder */ public function setLogQueries(bool $logQueries): self { $this->options['logQueries'] = $logQueries; return $this; } /** * An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Reserved. * * @param string $callbackUrl Reserved * @return $this Fluent Builder */ public function setCallbackUrl(string $callbackUrl): self { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * Reserved. * * @param string $callbackEvents Reserved * @return $this Fluent Builder */ public function setCallbackEvents(string $callbackEvents): self { $this->options['callbackEvents'] = $callbackEvents; return $this; } /** * The JSON string that defines the Assistant's [style sheet](https://www.twilio.com/docs/autopilot/api/assistant/stylesheet) * * @param array $styleSheet A JSON string that defines the Assistant's style * sheet * @return $this Fluent Builder */ public function setStyleSheet(array $styleSheet): self { $this->options['styleSheet'] = $styleSheet; return $this; } /** * A JSON object that defines the Assistant's [default tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios, including initiation actions and fallback tasks. * * @param array $defaults A JSON object that defines the Assistant's [default * tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios * @return $this Fluent Builder */ public function setDefaults(array $defaults): self { $this->options['defaults'] = $defaults; return $this; } /** * A string describing the state of the assistant. * * @param string $developmentStage A string describing the state of the * assistant. * @return $this Fluent Builder */ public function setDevelopmentStage(string $developmentStage): self { $this->options['developmentStage'] = $developmentStage; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Autopilot.V1.UpdateAssistantOptions ' . $options . ']'; } } Autopilot/V1/AssistantPage.php 0000644 00000002531 15107452350 0012274 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AssistantPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return AssistantInstance \Twilio\Rest\Autopilot\V1\AssistantInstance */ public function buildInstance(array $payload): AssistantInstance { return new AssistantInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Autopilot.V1.AssistantPage]'; } } Autopilot/V1.php 0000644 00000005100 15107452350 0007521 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Autopilot\V1\AssistantList; use Twilio\Rest\Autopilot\V1\RestoreAssistantList; use Twilio\Version; /** * @property AssistantList $assistants * @property RestoreAssistantList $restoreAssistant * @method \Twilio\Rest\Autopilot\V1\AssistantContext assistants(string $sid) */ class V1 extends Version { protected $_assistants; protected $_restoreAssistant; /** * Construct the V1 version of Autopilot * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } protected function getAssistants(): AssistantList { if (!$this->_assistants) { $this->_assistants = new AssistantList($this); } return $this->_assistants; } protected function getRestoreAssistant(): RestoreAssistantList { if (!$this->_restoreAssistant) { $this->_restoreAssistant = new RestoreAssistantList($this); } return $this->_restoreAssistant; } /** * 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.Autopilot.V1]'; } } Events/V1/SchemaContext.php 0000644 00000006226 15107452350 0011564 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Events\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Events\V1\Schema\SchemaVersionList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property SchemaVersionList $versions * @method \Twilio\Rest\Events\V1\Schema\SchemaVersionContext versions(int $schemaVersion) */ class SchemaContext extends InstanceContext { protected $_versions; /** * Initialize the SchemaContext * * @param Version $version Version that contains the resource * @param string $id The unique identifier of the schema. */ public function __construct(Version $version, $id) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Events/V1/EventTypeInstance.php 0000644 00000006551 15107452350 0012430 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Events\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $type * @property string $schemaId * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $description * @property string $url * @property array $links */ class EventTypeInstance extends InstanceResource { /** * Initialize the EventTypeInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $type A string that uniquely identifies this Event Type. */ public function __construct(Version $version, array $payload, string $type = null) { parent::__construct($version); // Marshaled Properties $this->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'), '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) . ']'; } } Events/V1/SubscriptionOptions.php 0000644 00000006250 15107452350 0013054 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Events\V1; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ abstract class SubscriptionOptions { /** * @param string $sinkSid Sink SID. * @return ReadSubscriptionOptions Options builder */ public static function read(string $sinkSid = Values::NONE): ReadSubscriptionOptions { return new ReadSubscriptionOptions($sinkSid); } /** * @param string $description Subscription description. * @param string $sinkSid Sink SID. * @return UpdateSubscriptionOptions Options builder */ public static function update(string $description = Values::NONE, string $sinkSid = Values::NONE): UpdateSubscriptionOptions { return new UpdateSubscriptionOptions($description, $sinkSid); } } class ReadSubscriptionOptions extends Options { /** * @param string $sinkSid Sink SID. */ public function __construct(string $sinkSid = Values::NONE) { $this->options['sinkSid'] = $sinkSid; } /** * The SID of the sink that the list of Subscriptions should be filtered by. * * @param string $sinkSid Sink SID. * @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 Subscription description. * @param string $sinkSid Sink SID. */ 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 Subscription description. * @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 Sink SID. * @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 . ']'; } } Events/V1/SinkPage.php 0000644 00000002330 15107452350 0010510 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Events\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SinkPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Events/V1/EventTypeList.php 0000644 00000012055 15107452350 0011573 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Events\V1; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class EventTypeList extends ListResource { /** * Construct the EventTypeList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Types'; } /** * 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']); } /** * 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); } /** * Retrieve a single page of EventTypeInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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]'; } } Events/V1/Schema/SchemaVersionContext.php 0000644 00000003544 15107452350 0014332 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Events\V1\Schema; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SchemaVersionContext extends InstanceContext { /** * Initialize the SchemaVersionContext * * @param Version $version Version that contains the resource * @param string $id The unique identifier of the schema. * @param int $schemaVersion The version of the schema */ public function __construct(Version $version, $id, $schemaVersion) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Events/V1/Schema/SchemaVersionInstance.php 0000644 00000006622 15107452350 0014452 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Events\V1\Schema; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $id * @property int $schemaVersion * @property \DateTime $dateCreated * @property string $url * @property string $raw */ class SchemaVersionInstance extends InstanceResource { /** * Initialize the SchemaVersionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $id The unique identifier of the schema. * @param int $schemaVersion The version of the schema */ public function __construct(Version $version, array $payload, string $id, int $schemaVersion = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Events/V1/Schema/SchemaVersionList.php 0000644 00000011572 15107452350 0013621 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Events\V1\Schema; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SchemaVersionList extends ListResource { /** * Construct the SchemaVersionList * * @param Version $version Version that contains the resource * @param string $id The unique identifier of the schema. */ public function __construct(Version $version, string $id) { parent::__construct($version); // Path Solution $this->solution = ['id' => $id, ]; $this->uri = '/Schemas/' . \rawurlencode($id) . '/Versions'; } /** * 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']); } /** * 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); } /** * 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]'; } } Events/V1/Schema/SchemaVersionPage.php 0000644 00000002463 15107452350 0013561 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Events\V1\Schema; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SchemaVersionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Events/V1/SchemaPage.php 0000644 00000002344 15107452350 0011011 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Events\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SchemaPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Events/V1/SubscriptionPage.php 0000644 00000002410 15107452350 0012267 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Events\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SubscriptionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Events/V1/SinkInstance.php 0000644 00000011023 15107452350 0011377 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Events\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Rest\Events\V1\Sink\SinkTestList; use Twilio\Rest\Events\V1\Sink\SinkValidateList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $description * @property string $sid * @property array $sinkConfiguration * @property string $sinkType * @property string $status * @property string $url * @property array $links */ class SinkInstance extends InstanceResource { protected $_sinkTest; protected $_sinkValidate; /** * Initialize the SinkInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid A string that uniquely identifies this Sink. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the SinkInstance * * @return SinkInstance Fetched SinkInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SinkInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Update the SinkInstance * * @param string $description Sink Description * @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) . ']'; } } Events/V1/SinkList.php 0000644 00000013504 15107452350 0010554 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Events\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SinkList extends ListResource { /** * Construct the SinkList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Sinks'; } /** * Create the SinkInstance * * @param string $description Sink Description. * @param array $sinkConfiguration JSON Sink configuration. * @param string $sinkType Sink type. * @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, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SinkInstance($this->version, $payload); } /** * 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']); } /** * 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); } /** * Retrieve a single page of SinkInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 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]'; } } Events/V1/Sink/SinkValidateList.php 0000644 00000003250 15107452350 0013127 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Events\V1\Sink; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SinkValidateList extends ListResource { /** * Construct the SinkValidateList * * @param Version $version Version that contains the resource * @param string $sid A string that uniquely identifies this Sink. */ public function __construct(Version $version, string $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Sinks/' . \rawurlencode($sid) . '/Validate'; } /** * Create the SinkValidateInstance * * @param string $testId A 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, ]); $payload = $this->version->create('POST', $this->uri, [], $data); 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]'; } } Events/V1/Sink/SinkValidateInstance.php 0000644 00000003430 15107452350 0013760 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Events\V1\Sink; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $result */ class SinkValidateInstance extends InstanceResource { /** * Initialize the SinkValidateInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid A string that uniquely identifies this Sink. */ public function __construct(Version $version, array $payload, string $sid) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Events/V1/Sink/SinkTestList.php 0000644 00000002656 15107452350 0012326 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Events\V1\Sink; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SinkTestList extends ListResource { /** * Construct the SinkTestList * * @param Version $version Version that contains the resource * @param string $sid A string that uniquely identifies this Sink. */ public function __construct(Version $version, string $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->create('POST', $this->uri); 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]'; } } Events/V1/Sink/SinkTestPage.php 0000644 00000002422 15107452350 0012256 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Events\V1\Sink; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SinkTestPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Events/V1/Sink/SinkValidatePage.php 0000644 00000002452 15107452350 0013073 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Events\V1\Sink; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SinkValidatePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Events/V1/Sink/SinkTestInstance.php 0000644 00000003414 15107452350 0013150 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Events\V1\Sink; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $result */ class SinkTestInstance extends InstanceResource { /** * Initialize the SinkTestInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid A string that uniquely identifies this Sink. */ public function __construct(Version $version, array $payload, string $sid) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Events/V1/SchemaInstance.php 0000644 00000006522 15107452350 0011703 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Events\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Rest\Events\V1\Schema\SchemaVersionList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $id * @property string $url * @property array $links * @property \DateTime $latestVersionDateCreated * @property int $latestVersion */ class SchemaInstance extends InstanceResource { protected $_versions; /** * Initialize the SchemaInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $id The unique identifier of the schema. */ public function __construct(Version $version, array $payload, string $id = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Events/V1/SinkOptions.php 0000644 00000004156 15107452350 0011277 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Events\V1; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ abstract class SinkOptions { /** * @param bool $inUse A boolean to return sinks used/not used by a subscription. * @param string $status A string to filter sinks by status. * @return ReadSinkOptions Options builder */ public static function read(bool $inUse = Values::NONE, string $status = Values::NONE): ReadSinkOptions { return new ReadSinkOptions($inUse, $status); } } class ReadSinkOptions extends Options { /** * @param bool $inUse A boolean to return sinks used/not used by a subscription. * @param string $status A string to filter sinks by status. */ public function __construct(bool $inUse = Values::NONE, string $status = Values::NONE) { $this->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 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 to filter sinks by 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.Events.V1.ReadSinkOptions ' . $options . ']'; } } Events/V1/SubscriptionList.php 0000644 00000013717 15107452350 0012342 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Events\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SubscriptionList extends ListResource { /** * Construct the SubscriptionList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Subscriptions'; } /** * 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']); } /** * 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); } /** * Retrieve a single page of SubscriptionInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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); } /** * Create the SubscriptionInstance * * @param string $description Subscription description * @param string $sinkSid Sink SID. * @param array[] $types 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); }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SubscriptionInstance($this->version, $payload); } /** * Constructs a SubscriptionContext * * @param string $sid A 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]'; } } Events/V1/EventTypePage.php 0000644 00000002366 15107452350 0011540 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Events\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class EventTypePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Events/V1/Subscription/SubscribedEventOptions.php 0000644 00000006145 15107452350 0016146 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Events\V1\Subscription; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ abstract class SubscribedEventOptions { /** * @param int $schemaVersion The schema version that the subscription should * use. * @return CreateSubscribedEventOptions Options builder */ public static function create(int $schemaVersion = Values::NONE): CreateSubscribedEventOptions { return new CreateSubscribedEventOptions($schemaVersion); } /** * @param int $schemaVersion The schema version that the subscription should * use. * @return UpdateSubscribedEventOptions Options builder */ public static function update(int $schemaVersion = Values::NONE): UpdateSubscribedEventOptions { return new UpdateSubscribedEventOptions($schemaVersion); } } class CreateSubscribedEventOptions extends Options { /** * @param int $schemaVersion The schema version that the subscription should * use. */ public function __construct(int $schemaVersion = Values::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.CreateSubscribedEventOptions ' . $options . ']'; } } class UpdateSubscribedEventOptions extends Options { /** * @param int $schemaVersion The schema version that the subscription should * use. */ public function __construct(int $schemaVersion = Values::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 . ']'; } } Events/V1/Subscription/SubscribedEventInstance.php 0000644 00000010111 15107452350 0016243 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Events\V1\Subscription; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $accountSid * @property string $type * @property int $schemaVersion * @property string $subscriptionSid * @property string $url */ class SubscribedEventInstance extends InstanceResource { /** * Initialize the SubscribedEventInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $subscriptionSid Subscription SID. * @param string $type Type of event being subscribed to. */ public function __construct(Version $version, array $payload, string $subscriptionSid, string $type = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Events/V1/Subscription/SubscribedEventContext.php 0000644 00000005633 15107452350 0016140 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Events\V1\Subscription; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SubscribedEventContext extends InstanceContext { /** * Initialize the SubscribedEventContext * * @param Version $version Version that contains the resource * @param string $subscriptionSid Subscription SID. * @param string $type Type of event being subscribed to. */ public function __construct(Version $version, $subscriptionSid, $type) { parent::__construct($version); // Path Solution $this->solution = ['subscriptionSid' => $subscriptionSid, 'type' => $type, ]; $this->uri = '/Subscriptions/' . \rawurlencode($subscriptionSid) . '/SubscribedEvents/' . \rawurlencode($type) . ''; } /** * Fetch the SubscribedEventInstance * * @return SubscribedEventInstance Fetched SubscribedEventInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SubscribedEventInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SubscribedEventInstance( $this->version, $payload, $this->solution['subscriptionSid'], $this->solution['type'] ); } /** * Delete the SubscribedEventInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Events/V1/Subscription/SubscribedEventList.php 0000644 00000013365 15107452350 0015430 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Events\V1\Subscription; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SubscribedEventList extends ListResource { /** * Construct the SubscribedEventList * * @param Version $version Version that contains the resource * @param string $subscriptionSid Subscription SID. */ public function __construct(Version $version, string $subscriptionSid) { parent::__construct($version); // Path Solution $this->solution = ['subscriptionSid' => $subscriptionSid, ]; $this->uri = '/Subscriptions/' . \rawurlencode($subscriptionSid) . '/SubscribedEvents'; } /** * 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']); } /** * 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); } /** * 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); } /** * 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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SubscribedEventInstance($this->version, $payload, $this->solution['subscriptionSid']); } /** * 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]'; } } Events/V1/Subscription/SubscribedEventPage.php 0000644 00000002530 15107452350 0015361 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Events\V1\Subscription; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SubscribedEventPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Events/V1/EventTypeOptions.php 0000644 00000003043 15107452350 0012310 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Events\V1; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ abstract class EventTypeOptions { /** * @param string $schemaId A string to filter Event Types by schema. * @return ReadEventTypeOptions Options builder */ public static function read(string $schemaId = Values::NONE): ReadEventTypeOptions { return new ReadEventTypeOptions($schemaId); } } class ReadEventTypeOptions extends Options { /** * @param string $schemaId A string to filter Event Types by schema. */ public function __construct(string $schemaId = Values::NONE) { $this->options['schemaId'] = $schemaId; } /** * A string parameter filtering the results to return only the Event Types using a given schema. * * @param string $schemaId A string to filter Event Types by 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 . ']'; } } Events/V1/EventTypeContext.php 0000644 00000003134 15107452350 0012302 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Events\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class EventTypeContext extends InstanceContext { /** * Initialize the EventTypeContext * * @param Version $version Version that contains the resource * @param string $type A string that uniquely identifies this Event Type. */ public function __construct(Version $version, $type) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Events/V1/SchemaList.php 0000644 00000002072 15107452350 0011046 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Events\V1; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SchemaList extends ListResource { /** * Construct the SchemaList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; } /** * Constructs a SchemaContext * * @param string $id The unique identifier of the schema. */ 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]'; } } Events/V1/SubscriptionInstance.php 0000644 00000010605 15107452350 0013164 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Events\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Events\V1\Subscription\SubscribedEventList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $accountSid * @property string $sid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $description * @property string $sinkSid * @property string $url * @property array $links */ class SubscriptionInstance extends InstanceResource { protected $_subscribedEvents; /** * Initialize the SubscriptionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid A string that uniquely identifies this Subscription. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * 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) . ']'; } } Events/V1/SubscriptionContext.php 0000644 00000010342 15107452350 0013042 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Events\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Events\V1\Subscription\SubscribedEventList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property SubscribedEventList $subscribedEvents * @method \Twilio\Rest\Events\V1\Subscription\SubscribedEventContext subscribedEvents(string $type) */ class SubscriptionContext extends InstanceContext { protected $_subscribedEvents; /** * Initialize the SubscriptionContext * * @param Version $version Version that contains the resource * @param string $sid A string that uniquely identifies this Subscription. */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Subscriptions/' . \rawurlencode($sid) . ''; } /** * Fetch the SubscriptionInstance * * @return SubscriptionInstance Fetched SubscriptionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SubscriptionInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SubscriptionInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the SubscriptionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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) . ']'; } } Events/V1/SinkContext.php 0000644 00000010325 15107452350 0011263 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Events\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Events\V1\Sink\SinkTestList; use Twilio\Rest\Events\V1\Sink\SinkValidateList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property SinkTestList $sinkTest * @property SinkValidateList $sinkValidate */ class SinkContext extends InstanceContext { protected $_sinkTest; protected $_sinkValidate; /** * Initialize the SinkContext * * @param Version $version Version that contains the resource * @param string $sid A string that uniquely identifies this Sink. */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Sinks/' . \rawurlencode($sid) . ''; } /** * Fetch the SinkInstance * * @return SinkInstance Fetched SinkInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SinkInstance { $payload = $this->version->fetch('GET', $this->uri); return new SinkInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the SinkInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the SinkInstance * * @param string $description Sink Description * @return SinkInstance Updated SinkInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $description): SinkInstance { $data = Values::of(['Description' => $description, ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } Events/V1.php 0000644 00000006377 15107452350 0007026 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Events; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Events\V1\EventTypeList; use Twilio\Rest\Events\V1\SchemaList; use Twilio\Rest\Events\V1\SinkList; use Twilio\Rest\Events\V1\SubscriptionList; use Twilio\Version; /** * @property EventTypeList $eventTypes * @property SchemaList $schemas * @property SinkList $sinks * @property SubscriptionList $subscriptions * @method \Twilio\Rest\Events\V1\EventTypeContext eventTypes(string $type) * @method \Twilio\Rest\Events\V1\SchemaContext schemas(string $id) * @method \Twilio\Rest\Events\V1\SinkContext sinks(string $sid) * @method \Twilio\Rest\Events\V1\SubscriptionContext subscriptions(string $sid) */ class V1 extends Version { protected $_eventTypes; protected $_schemas; protected $_sinks; protected $_subscriptions; /** * Construct the V1 version of Events * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->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]'; } } FrontlineApi.php 0000644 00000005005 15107452350 0007651 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\FrontlineApi\V1; /** * @property \Twilio\Rest\FrontlineApi\V1 $v1 * @property \Twilio\Rest\FrontlineApi\V1\UserList $users * @method \Twilio\Rest\FrontlineApi\V1\UserContext users(string $sid) */ class FrontlineApi extends Domain { protected $_v1; /** * Construct the FrontlineApi Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->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); } protected function getUsers(): \Twilio\Rest\FrontlineApi\V1\UserList { return $this->v1->users; } /** * @param string $sid The SID of the User resource to fetch */ protected function contextUsers(string $sid): \Twilio\Rest\FrontlineApi\V1\UserContext { return $this->v1->users($sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.FrontlineApi]'; } } Preview/Wireless.php 0000644 00000005623 15107452350 0010503 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Preview\Wireless\CommandList; use Twilio\Rest\Preview\Wireless\RatePlanList; use Twilio\Rest\Preview\Wireless\SimList; use Twilio\Version; /** * @property CommandList $commands * @property RatePlanList $ratePlans * @property SimList $sims * @method \Twilio\Rest\Preview\Wireless\CommandContext commands(string $sid) * @method \Twilio\Rest\Preview\Wireless\RatePlanContext ratePlans(string $sid) * @method \Twilio\Rest\Preview\Wireless\SimContext sims(string $sid) */ class Wireless extends Version { protected $_commands; protected $_ratePlans; protected $_sims; /** * Construct the Wireless version of Preview * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->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]'; } } Preview/HostedNumbers/AuthorizationDocumentInstance.php 0000644 00000011053 15107452350 0017506 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\HostedNumbers; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Preview\HostedNumbers\AuthorizationDocument\DependentHostedNumberOrderList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $addressSid * @property string $status * @property string $email * @property string[] $ccEmails * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class AuthorizationDocumentInstance extends InstanceResource { protected $_dependentHostedNumberOrders; /** * Initialize the AuthorizationDocumentInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid AuthorizationDocument sid. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Preview/HostedNumbers/HostedNumberOrderInstance.php 0000644 00000013776 15107452350 0016560 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\HostedNumbers; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $accountSid * @property string $incomingPhoneNumberSid * @property string $addressSid * @property string $signingDocumentSid * @property string $phoneNumber * @property string $capabilities * @property string $friendlyName * @property string $uniqueName * @property string $status * @property string $failureReason * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property int $verificationAttempts * @property string $email * @property string[] $ccEmails * @property string $url * @property string $verificationType * @property string $verificationDocumentSid * @property string $extension * @property int $callDelay * @property string $verificationCode * @property string[] $verificationCallSids */ class HostedNumberOrderInstance extends InstanceResource { /** * Initialize the HostedNumberOrderInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid HostedNumberOrder sid. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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' => 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; } /** * Fetch the HostedNumberOrderInstance * * @return HostedNumberOrderInstance Fetched HostedNumberOrderInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): HostedNumberOrderInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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) . ']'; } } Preview/HostedNumbers/HostedNumberOrderPage.php 0000644 00000002644 15107452350 0015660 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\HostedNumbers; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class HostedNumberOrderPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Preview/HostedNumbers/HostedNumberOrderOptions.php 0000644 00000055741 15107452350 0016445 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\HostedNumbers; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class HostedNumberOrderOptions { /** * @param string $friendlyName A human readable description of this resource. * @param string $uniqueName A unique, developer assigned name of this * HostedNumberOrder. * @param string $email Email. * @param string[] $ccEmails A list of emails. * @param string $status The Status of this HostedNumberOrder. * @param string $verificationCode A verification code. * @param string $verificationType Verification Type. * @param string $verificationDocumentSid Verification Document Sid * @param string $extension Digits to dial after connecting the verification * call. * @param int $callDelay The number of seconds, between 0 and 60, to delay * before initiating the verification call. * @return UpdateHostedNumberOrderOptions Options builder */ public static function update(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::NONE): UpdateHostedNumberOrderOptions { return new UpdateHostedNumberOrderOptions($friendlyName, $uniqueName, $email, $ccEmails, $status, $verificationCode, $verificationType, $verificationDocumentSid, $extension, $callDelay); } /** * @param string $status The Status of this HostedNumberOrder. * @param string $phoneNumber An E164 formatted phone number. * @param string $incomingPhoneNumberSid IncomingPhoneNumber sid. * @param string $friendlyName A human readable description of this resource. * @param string $uniqueName A unique, developer assigned name of this * HostedNumberOrder. * @return ReadHostedNumberOrderOptions Options builder */ public static function read(string $status = Values::NONE, string $phoneNumber = Values::NONE, string $incomingPhoneNumberSid = Values::NONE, string $friendlyName = Values::NONE, string $uniqueName = Values::NONE): ReadHostedNumberOrderOptions { return new ReadHostedNumberOrderOptions($status, $phoneNumber, $incomingPhoneNumberSid, $friendlyName, $uniqueName); } /** * @param string $accountSid Account Sid. * @param string $friendlyName A human readable description of this resource. * @param string $uniqueName A unique, developer assigned name of this * HostedNumberOrder. * @param string[] $ccEmails A list of emails. * @param string $smsUrl SMS URL. * @param string $smsMethod SMS Method. * @param string $smsFallbackUrl SMS Fallback URL. * @param string $smsFallbackMethod SMS Fallback Method. * @param string $statusCallbackUrl Status Callback URL. * @param string $statusCallbackMethod Status Callback Method. * @param string $smsApplicationSid SMS Application Sid. * @param string $addressSid Address sid. * @param string $email Email. * @param string $verificationType Verification Type. * @param string $verificationDocumentSid Verification Document Sid * @return CreateHostedNumberOrderOptions Options builder */ public static function create(string $accountSid = Values::NONE, string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, array $ccEmails = Values::ARRAY_NONE, string $smsUrl = Values::NONE, string $smsMethod = Values::NONE, string $smsFallbackUrl = Values::NONE, string $smsFallbackMethod = Values::NONE, string $statusCallbackUrl = Values::NONE, string $statusCallbackMethod = Values::NONE, string $smsApplicationSid = Values::NONE, string $addressSid = Values::NONE, string $email = Values::NONE, string $verificationType = Values::NONE, string $verificationDocumentSid = Values::NONE): CreateHostedNumberOrderOptions { return new CreateHostedNumberOrderOptions($accountSid, $friendlyName, $uniqueName, $ccEmails, $smsUrl, $smsMethod, $smsFallbackUrl, $smsFallbackMethod, $statusCallbackUrl, $statusCallbackMethod, $smsApplicationSid, $addressSid, $email, $verificationType, $verificationDocumentSid); } } class UpdateHostedNumberOrderOptions extends Options { /** * @param string $friendlyName A human readable description of this resource. * @param string $uniqueName A unique, developer assigned name of this * HostedNumberOrder. * @param string $email Email. * @param string[] $ccEmails A list of emails. * @param string $status The Status of this HostedNumberOrder. * @param string $verificationCode A verification code. * @param string $verificationType Verification Type. * @param string $verificationDocumentSid Verification Document Sid * @param string $extension Digits to dial after connecting the verification * call. * @param int $callDelay The number of seconds, between 0 and 60, to delay * before initiating the verification call. */ public function __construct(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::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['email'] = $email; $this->options['ccEmails'] = $ccEmails; $this->options['status'] = $status; $this->options['verificationCode'] = $verificationCode; $this->options['verificationType'] = $verificationType; $this->options['verificationDocumentSid'] = $verificationDocumentSid; $this->options['extension'] = $extension; $this->options['callDelay'] = $callDelay; } /** * A 64 character string that is a human readable text that describes this resource. * * @param string $friendlyName A human readable description of this resource. * @return $this Fluent Builder */ public function setFriendlyName(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 A unique, developer assigned name of this * HostedNumberOrder. * @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. * @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 A list of emails. * @return $this Fluent Builder */ public function setCcEmails(array $ccEmails): self { $this->options['ccEmails'] = $ccEmails; return $this; } /** * User can only post to `pending-verification` status to transition the HostedNumberOrder to initiate a verification call or verification of ownership with a copy of a phone bill. * * @param string $status The Status of this HostedNumberOrder. * @return $this Fluent Builder */ public function setStatus(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. * @return $this Fluent Builder */ public function setVerificationCode(string $verificationCode): self { $this->options['verificationCode'] = $verificationCode; return $this; } /** * Optional. The method used for verifying ownership of the number to be hosted. One of phone-call (default) or phone-bill. * * @param string $verificationType Verification Type. * @return $this Fluent Builder */ public function setVerificationType(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 Verification Document Sid * @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. * @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 . ']'; } } class ReadHostedNumberOrderOptions extends Options { /** * @param string $status The Status of this HostedNumberOrder. * @param string $phoneNumber An E164 formatted phone number. * @param string $incomingPhoneNumberSid IncomingPhoneNumber sid. * @param string $friendlyName A human readable description of this resource. * @param string $uniqueName A unique, developer assigned name of this * HostedNumberOrder. */ public function __construct(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. * @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. * @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 IncomingPhoneNumber sid. * @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. * @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 A unique, developer assigned name of this * HostedNumberOrder. * @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 CreateHostedNumberOrderOptions extends Options { /** * @param string $accountSid Account Sid. * @param string $friendlyName A human readable description of this resource. * @param string $uniqueName A unique, developer assigned name of this * HostedNumberOrder. * @param string[] $ccEmails A list of emails. * @param string $smsUrl SMS URL. * @param string $smsMethod SMS Method. * @param string $smsFallbackUrl SMS Fallback URL. * @param string $smsFallbackMethod SMS Fallback Method. * @param string $statusCallbackUrl Status Callback URL. * @param string $statusCallbackMethod Status Callback Method. * @param string $smsApplicationSid SMS Application Sid. * @param string $addressSid Address sid. * @param string $email Email. * @param string $verificationType Verification Type. * @param string $verificationDocumentSid Verification Document Sid */ public function __construct(string $accountSid = Values::NONE, string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, array $ccEmails = Values::ARRAY_NONE, string $smsUrl = Values::NONE, string $smsMethod = Values::NONE, string $smsFallbackUrl = Values::NONE, string $smsFallbackMethod = Values::NONE, string $statusCallbackUrl = Values::NONE, string $statusCallbackMethod = Values::NONE, string $smsApplicationSid = Values::NONE, string $addressSid = Values::NONE, string $email = Values::NONE, string $verificationType = Values::NONE, string $verificationDocumentSid = Values::NONE) { $this->options['accountSid'] = $accountSid; $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['ccEmails'] = $ccEmails; $this->options['smsUrl'] = $smsUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['statusCallbackUrl'] = $statusCallbackUrl; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['smsApplicationSid'] = $smsApplicationSid; $this->options['addressSid'] = $addressSid; $this->options['email'] = $email; $this->options['verificationType'] = $verificationType; $this->options['verificationDocumentSid'] = $verificationDocumentSid; } /** * This defaults to the AccountSid of the authorization the user is using. This can be provided to specify a subaccount to add the HostedNumberOrder to. * * @param string $accountSid Account Sid. * @return $this Fluent Builder */ public function setAccountSid(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 human readable description of 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 A unique, developer assigned name of this * HostedNumberOrder. * @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 A list of emails. * @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 SMS URL. * @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 SMS Method. * @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 SMS Fallback URL. * @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 SMS Fallback Method. * @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 Status Callback URL. * @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 Status Callback Method. * @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 SMS Application Sid. * @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 Address sid. * @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 Email. * @return $this Fluent Builder */ public function setEmail(string $email): self { $this->options['email'] = $email; return $this; } /** * Optional. The method used for verifying ownership of the number to be hosted. One of phone-call (default) or phone-bill. * * @param string $verificationType Verification Type. * @return $this Fluent Builder */ public function setVerificationType(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 Verification Document Sid * @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 . ']'; } } Preview/HostedNumbers/AuthorizationDocumentPage.php 0000644 00000002674 15107452350 0016627 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\HostedNumbers; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AuthorizationDocumentPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderList.php 0000644 00000013356 15107452350 0024107 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\HostedNumbers\AuthorizationDocument; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DependentHostedNumberOrderList extends ListResource { /** * Construct the DependentHostedNumberOrderList * * @param Version $version Version that contains the resource * @param string $signingDocumentSid LOA document sid. */ public function __construct(Version $version, string $signingDocumentSid) { parent::__construct($version); // Path Solution $this->solution = ['signingDocumentSid' => $signingDocumentSid, ]; $this->uri = '/AuthorizationDocuments/' . \rawurlencode($signingDocumentSid) . '/DependentHostedNumberOrders'; } /** * Streams DependentHostedNumberOrderInstance records from the API as a * generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of DependentHostedNumberOrderInstance records from * the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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]'; } } Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderOptions.php 0000644 00000011507 15107452350 0024623 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\HostedNumbers\AuthorizationDocument; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class DependentHostedNumberOrderOptions { /** * @param string $status The Status of this HostedNumberOrder. * @param string $phoneNumber An E164 formatted phone number. * @param string $incomingPhoneNumberSid IncomingPhoneNumber sid. * @param string $friendlyName A human readable description of this resource. * @param string $uniqueName A unique, developer assigned name of this * HostedNumberOrder. * @return ReadDependentHostedNumberOrderOptions Options builder */ public static function read(string $status = Values::NONE, string $phoneNumber = Values::NONE, string $incomingPhoneNumberSid = Values::NONE, string $friendlyName = Values::NONE, string $uniqueName = Values::NONE): ReadDependentHostedNumberOrderOptions { return new ReadDependentHostedNumberOrderOptions($status, $phoneNumber, $incomingPhoneNumberSid, $friendlyName, $uniqueName); } } class ReadDependentHostedNumberOrderOptions extends Options { /** * @param string $status The Status of this HostedNumberOrder. * @param string $phoneNumber An E164 formatted phone number. * @param string $incomingPhoneNumberSid IncomingPhoneNumber sid. * @param string $friendlyName A human readable description of this resource. * @param string $uniqueName A unique, developer assigned name of this * HostedNumberOrder. */ public function __construct(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; } /** * Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/api/phone-numbers/hosted-number-authorization-documents#status-values) for more information on each of these statuses. * * @param string $status The Status of this HostedNumberOrder. * @return $this Fluent Builder */ public function setStatus(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. * @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 IncomingPhoneNumber sid. * @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. * @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 A unique, developer assigned name of this * HostedNumberOrder. * @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 . ']'; } } Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderInstance.php 0000644 00000010577 15107452350 0024742 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\HostedNumbers\AuthorizationDocument; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $accountSid * @property string $incomingPhoneNumberSid * @property string $addressSid * @property string $signingDocumentSid * @property string $phoneNumber * @property string $capabilities * @property string $friendlyName * @property string $uniqueName * @property string $status * @property string $failureReason * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property int $verificationAttempts * @property string $email * @property string[] $ccEmails * @property string $verificationType * @property string $verificationDocumentSid * @property string $extension * @property int $callDelay * @property string $verificationCode * @property string[] $verificationCallSids */ class DependentHostedNumberOrderInstance extends InstanceResource { /** * Initialize the DependentHostedNumberOrderInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $signingDocumentSid LOA document sid. */ public function __construct(Version $version, array $payload, string $signingDocumentSid) { parent::__construct($version); // Marshaled Properties $this->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' => 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]'; } } Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderPage.php 0000644 00000003133 15107452350 0024040 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\HostedNumbers\AuthorizationDocument; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DependentHostedNumberOrderPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Preview/HostedNumbers/HostedNumberOrderList.php 0000644 00000016474 15107452350 0015725 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\HostedNumbers; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class HostedNumberOrderList extends ListResource { /** * Construct the HostedNumberOrderList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/HostedNumberOrders'; } /** * Streams HostedNumberOrderInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of HostedNumberOrderInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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); } /** * Create the HostedNumberOrderInstance * * @param string $phoneNumber An E164 formatted phone number. * @param bool $smsCapability Specify SMS capability to host. * @param array|Options $options Optional Arguments * @return HostedNumberOrderInstance 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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new HostedNumberOrderInstance($this->version, $payload); } /** * Constructs a HostedNumberOrderContext * * @param string $sid HostedNumberOrder sid. */ 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]'; } } Preview/HostedNumbers/HostedNumberOrderContext.php 0000644 00000006352 15107452350 0016430 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\HostedNumbers; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class HostedNumberOrderContext extends InstanceContext { /** * Initialize the HostedNumberOrderContext * * @param Version $version Version that contains the resource * @param string $sid HostedNumberOrder sid. */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/HostedNumberOrders/' . \rawurlencode($sid) . ''; } /** * Fetch the HostedNumberOrderInstance * * @return HostedNumberOrderInstance Fetched HostedNumberOrderInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): HostedNumberOrderInstance { $payload = $this->version->fetch('GET', $this->uri); return new HostedNumberOrderInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the HostedNumberOrderInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the HostedNumberOrderInstance * * @param array|Options $options Optional Arguments * @return HostedNumberOrderInstance Updated HostedNumberOrderInstance * @throws TwilioException When an HTTP error occurs. */ public function update(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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } Preview/HostedNumbers/AuthorizationDocumentContext.php 0000644 00000011236 15107452350 0017371 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\HostedNumbers; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Preview\HostedNumbers\AuthorizationDocument\DependentHostedNumberOrderList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property DependentHostedNumberOrderList $dependentHostedNumberOrders */ class AuthorizationDocumentContext extends InstanceContext { protected $_dependentHostedNumberOrders; /** * Initialize the AuthorizationDocumentContext * * @param Version $version Version that contains the resource * @param string $sid AuthorizationDocument sid. */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } Preview/HostedNumbers/AuthorizationDocumentList.php 0000644 00000015631 15107452350 0016663 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\HostedNumbers; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AuthorizationDocumentList extends ListResource { /** * Construct the AuthorizationDocumentList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/AuthorizationDocuments'; } /** * Streams AuthorizationDocumentInstance records from the API as a generator * stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of AuthorizationDocumentInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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); } /** * Create the AuthorizationDocumentInstance * * @param string[] $hostedNumberOrderSids A list of HostedNumberOrder sids. * @param string $addressSid Address sid. * @param string $email Email. * @param string $contactTitle Title of signee of this Authorization Document. * @param string $contactPhoneNumber Authorization Document's signee's phone * number. * @param array|Options $options Optional Arguments * @return AuthorizationDocumentInstance 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; }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AuthorizationDocumentInstance($this->version, $payload); } /** * Constructs a AuthorizationDocumentContext * * @param string $sid AuthorizationDocument sid. */ 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]'; } } Preview/HostedNumbers/AuthorizationDocumentOptions.php 0000644 00000022075 15107452350 0017403 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\HostedNumbers; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class AuthorizationDocumentOptions { /** * @param string[] $hostedNumberOrderSids A list of HostedNumberOrder sids. * @param string $addressSid Address sid. * @param string $email Email. * @param string[] $ccEmails A list of emails. * @param string $status The Status of this AuthorizationDocument. * @param string $contactTitle Title of signee of this Authorization Document. * @param string $contactPhoneNumber Authorization Document's signee's phone * number. * @return UpdateAuthorizationDocumentOptions Options builder */ public static function update(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): UpdateAuthorizationDocumentOptions { return new UpdateAuthorizationDocumentOptions($hostedNumberOrderSids, $addressSid, $email, $ccEmails, $status, $contactTitle, $contactPhoneNumber); } /** * @param string $email Email. * @param string $status The Status of this AuthorizationDocument. * @return ReadAuthorizationDocumentOptions Options builder */ public static function read(string $email = Values::NONE, string $status = Values::NONE): ReadAuthorizationDocumentOptions { return new ReadAuthorizationDocumentOptions($email, $status); } /** * @param string[] $ccEmails A list of emails. * @return CreateAuthorizationDocumentOptions Options builder */ public static function create(array $ccEmails = Values::ARRAY_NONE): CreateAuthorizationDocumentOptions { return new CreateAuthorizationDocumentOptions($ccEmails); } } class UpdateAuthorizationDocumentOptions extends Options { /** * @param string[] $hostedNumberOrderSids A list of HostedNumberOrder sids. * @param string $addressSid Address sid. * @param string $email Email. * @param string[] $ccEmails A list of emails. * @param string $status The Status of this AuthorizationDocument. * @param string $contactTitle Title of signee of this Authorization Document. * @param string $contactPhoneNumber Authorization Document's signee's phone * number. */ public function __construct(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. * @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 Address sid. * @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. * @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 A list of emails. * @return $this Fluent Builder */ public function setCcEmails(array $ccEmails): self { $this->options['ccEmails'] = $ccEmails; return $this; } /** * Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/api/phone-numbers/hosted-number-authorization-documents#status-values) for more information on each of these statuses. * * @param string $status The Status of this AuthorizationDocument. * @return $this Fluent Builder */ public function setStatus(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 Title of signee of this Authorization Document. * @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 Authorization Document's signee's phone * number. * @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 . ']'; } } class ReadAuthorizationDocumentOptions extends Options { /** * @param string $email Email. * @param string $status The Status of this AuthorizationDocument. */ 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. * @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/api/phone-numbers/hosted-number-authorization-documents#status-values) for more information on each of these statuses. * * @param string $status The Status of this AuthorizationDocument. * @return $this Fluent Builder */ public function setStatus(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 CreateAuthorizationDocumentOptions extends Options { /** * @param string[] $ccEmails A list of emails. */ public function __construct(array $ccEmails = Values::ARRAY_NONE) { $this->options['ccEmails'] = $ccEmails; } /** * Email recipients who will be informed when an Authorization Document has been sent and signed. * * @param string[] $ccEmails A list of emails. * @return $this Fluent Builder */ public function setCcEmails(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 . ']'; } } Preview/DeployedDevices/FleetOptions.php 0000644 00000007256 15107452350 0014375 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class FleetOptions { /** * @param string $friendlyName A human readable description for this Fleet. * @return CreateFleetOptions Options builder */ public static function create(string $friendlyName = Values::NONE): CreateFleetOptions { return new CreateFleetOptions($friendlyName); } /** * @param string $friendlyName A human readable description for this Fleet. * @param string $defaultDeploymentSid A default Deployment SID. * @return UpdateFleetOptions Options builder */ public static function update(string $friendlyName = Values::NONE, string $defaultDeploymentSid = Values::NONE): UpdateFleetOptions { return new UpdateFleetOptions($friendlyName, $defaultDeploymentSid); } } class CreateFleetOptions extends Options { /** * @param string $friendlyName A human readable description for this Fleet. */ public function __construct(string $friendlyName = Values::NONE) { $this->options['friendlyName'] = $friendlyName; } /** * Provides a human readable descriptive text for this Fleet, up to 256 characters long. * * @param string $friendlyName A human readable description for this Fleet. * @return $this Fluent Builder */ public function setFriendlyName(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 A human readable description for this Fleet. * @param string $defaultDeploymentSid A default Deployment SID. */ 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 A human readable description for this Fleet. * @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 A default Deployment SID. * @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 . ']'; } } Preview/DeployedDevices/Fleet/KeyOptions.php 0000644 00000013025 15107452350 0015114 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class KeyOptions { /** * @param string $friendlyName The human readable description for this Key. * @param string $deviceSid The unique identifier of a Key to be authenticated. * @return CreateKeyOptions Options builder */ public static function create(string $friendlyName = Values::NONE, string $deviceSid = Values::NONE): CreateKeyOptions { return new CreateKeyOptions($friendlyName, $deviceSid); } /** * @param string $deviceSid Find all Keys authenticating specified Device. * @return ReadKeyOptions Options builder */ public static function read(string $deviceSid = Values::NONE): ReadKeyOptions { return new ReadKeyOptions($deviceSid); } /** * @param string $friendlyName The human readable description for this Key. * @param string $deviceSid The unique identifier of a Key to be authenticated. * @return UpdateKeyOptions Options builder */ public static function update(string $friendlyName = Values::NONE, string $deviceSid = Values::NONE): UpdateKeyOptions { return new UpdateKeyOptions($friendlyName, $deviceSid); } } class CreateKeyOptions extends Options { /** * @param string $friendlyName The human readable description for this Key. * @param string $deviceSid The unique identifier of a Key to be authenticated. */ public function __construct(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 The human readable description for this Key. * @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 The unique identifier of a Key to be authenticated. * @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 Find all Keys authenticating specified 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 Find all Keys authenticating specified 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 The human readable description for this Key. * @param string $deviceSid The unique identifier of a Key to be authenticated. */ 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 The human readable description for this Key. * @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 The unique identifier of a Key to be authenticated. * @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 . ']'; } } Preview/DeployedDevices/Fleet/KeyContext.php 0000644 00000005540 15107452350 0015110 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class KeyContext extends InstanceContext { /** * Initialize the KeyContext * * @param Version $version Version that contains the resource * @param string $fleetSid The fleet_sid * @param string $sid A string that uniquely identifies the Key. */ public function __construct(Version $version, $fleetSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['fleetSid' => $fleetSid, 'sid' => $sid, ]; $this->uri = '/Fleets/' . \rawurlencode($fleetSid) . '/Keys/' . \rawurlencode($sid) . ''; } /** * Fetch the KeyInstance * * @return KeyInstance Fetched KeyInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): KeyInstance { $payload = $this->version->fetch('GET', $this->uri); return new KeyInstance( $this->version, $payload, $this->solution['fleetSid'], $this->solution['sid'] ); } /** * Delete the KeyInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the KeyInstance * * @param array|Options $options Optional Arguments * @return KeyInstance Updated KeyInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): KeyInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'DeviceSid' => $options['deviceSid'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new KeyInstance( $this->version, $payload, $this->solution['fleetSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.DeployedDevices.KeyContext ' . \implode(' ', $context) . ']'; } } Preview/DeployedDevices/Fleet/CertificateOptions.php 0000644 00000014411 15107452350 0016606 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class CertificateOptions { /** * @param string $friendlyName The human readable description for this * Certificate. * @param string $deviceSid The unique identifier of a Device to be * authenticated. * @return CreateCertificateOptions Options builder */ public static function create(string $friendlyName = Values::NONE, string $deviceSid = Values::NONE): CreateCertificateOptions { return new CreateCertificateOptions($friendlyName, $deviceSid); } /** * @param string $deviceSid Find all Certificates authenticating specified * Device. * @return ReadCertificateOptions Options builder */ public static function read(string $deviceSid = Values::NONE): ReadCertificateOptions { return new ReadCertificateOptions($deviceSid); } /** * @param string $friendlyName The human readable description for this * Certificate. * @param string $deviceSid The unique identifier of a Device to be * authenticated. * @return UpdateCertificateOptions Options builder */ public static function update(string $friendlyName = Values::NONE, string $deviceSid = Values::NONE): UpdateCertificateOptions { return new UpdateCertificateOptions($friendlyName, $deviceSid); } } class CreateCertificateOptions extends Options { /** * @param string $friendlyName The human readable description for this * Certificate. * @param string $deviceSid The unique identifier of a Device to be * authenticated. */ public function __construct(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 The human readable description for this * Certificate. * @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 The unique identifier of a Device to be * authenticated. * @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 Find all Certificates authenticating specified * 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 Find all Certificates authenticating specified * 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 The human readable description for this * Certificate. * @param string $deviceSid The unique identifier of a Device to be * authenticated. */ 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 The human readable description for this * Certificate. * @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 The unique identifier of a Device to be * authenticated. * @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 . ']'; } } Preview/DeployedDevices/Fleet/DeploymentContext.php 0000644 00000005732 15107452350 0016503 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DeploymentContext extends InstanceContext { /** * Initialize the DeploymentContext * * @param Version $version Version that contains the resource * @param string $fleetSid The fleet_sid * @param string $sid A string that uniquely identifies the Deployment. */ public function __construct(Version $version, $fleetSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['fleetSid' => $fleetSid, 'sid' => $sid, ]; $this->uri = '/Fleets/' . \rawurlencode($fleetSid) . '/Deployments/' . \rawurlencode($sid) . ''; } /** * Fetch the DeploymentInstance * * @return DeploymentInstance Fetched DeploymentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DeploymentInstance { $payload = $this->version->fetch('GET', $this->uri); return new DeploymentInstance( $this->version, $payload, $this->solution['fleetSid'], $this->solution['sid'] ); } /** * Delete the DeploymentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the DeploymentInstance * * @param array|Options $options Optional Arguments * @return DeploymentInstance Updated DeploymentInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): DeploymentInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'SyncServiceSid' => $options['syncServiceSid'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new DeploymentInstance( $this->version, $payload, $this->solution['fleetSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.DeployedDevices.DeploymentContext ' . \implode(' ', $context) . ']'; } } Preview/DeployedDevices/Fleet/DeploymentOptions.php 0000644 00000011435 15107452350 0016507 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class DeploymentOptions { /** * @param string $friendlyName A human readable description for this Deployment. * @param string $syncServiceSid The unique identifier of the Sync service * instance. * @return CreateDeploymentOptions Options builder */ public static function create(string $friendlyName = Values::NONE, string $syncServiceSid = Values::NONE): CreateDeploymentOptions { return new CreateDeploymentOptions($friendlyName, $syncServiceSid); } /** * @param string $friendlyName A human readable description for this Deployment. * @param string $syncServiceSid The unique identifier of the Sync service * instance. * @return UpdateDeploymentOptions Options builder */ public static function update(string $friendlyName = Values::NONE, string $syncServiceSid = Values::NONE): UpdateDeploymentOptions { return new UpdateDeploymentOptions($friendlyName, $syncServiceSid); } } class CreateDeploymentOptions extends Options { /** * @param string $friendlyName A human readable description for this Deployment. * @param string $syncServiceSid The unique identifier of the Sync service * instance. */ public function __construct(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 256 characters long. * * @param string $friendlyName A human readable description for this Deployment. * @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 The unique identifier of the Sync service * instance. * @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 A human readable description for this Deployment. * @param string $syncServiceSid The unique identifier of the Sync service * instance. */ 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 A human readable description for this Deployment. * @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 The unique identifier of the Sync service * instance. * @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 . ']'; } } Preview/DeployedDevices/Fleet/DeploymentInstance.php 0000644 00000010676 15107452350 0016626 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $url * @property string $friendlyName * @property string $fleetSid * @property string $accountSid * @property string $syncServiceSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated */ class DeploymentInstance extends InstanceResource { /** * Initialize the DeploymentInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $fleetSid The unique identifier of the Fleet. * @param string $sid A string that uniquely identifies the Deployment. */ public function __construct(Version $version, array $payload, string $fleetSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the DeploymentInstance * * @return DeploymentInstance Fetched DeploymentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DeploymentInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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) . ']'; } } Preview/DeployedDevices/Fleet/CertificateList.php 0000644 00000014342 15107452350 0016071 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class CertificateList extends ListResource { /** * Construct the CertificateList * * @param Version $version Version that contains the resource * @param string $fleetSid The unique identifier of the Fleet. */ public function __construct(Version $version, string $fleetSid) { parent::__construct($version); // Path Solution $this->solution = ['fleetSid' => $fleetSid, ]; $this->uri = '/Fleets/' . \rawurlencode($fleetSid) . '/Certificates'; } /** * Create the CertificateInstance * * @param string $certificateData The public certificate data. * @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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CertificateInstance($this->version, $payload, $this->solution['fleetSid']); } /** * Streams CertificateInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of CertificateInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 A string that uniquely identifies the Certificate. */ 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]'; } } Preview/DeployedDevices/Fleet/DeviceList.php 0000644 00000014245 15107452350 0015050 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DeviceList extends ListResource { /** * Construct the DeviceList * * @param Version $version Version that contains the resource * @param string $fleetSid The unique identifier of the Fleet. */ public function __construct(Version $version, string $fleetSid) { parent::__construct($version); // Path Solution $this->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']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new DeviceInstance($this->version, $payload, $this->solution['fleetSid']); } /** * Streams DeviceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of DeviceInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 A string that uniquely identifies the Device. */ 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]'; } } Preview/DeployedDevices/Fleet/DeploymentPage.php 0000644 00000002651 15107452350 0015730 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DeploymentPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Preview/DeployedDevices/Fleet/KeyList.php 0000644 00000013603 15107452350 0014376 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class KeyList extends ListResource { /** * Construct the KeyList * * @param Version $version Version that contains the resource * @param string $fleetSid The unique identifier of the Fleet. */ public function __construct(Version $version, string $fleetSid) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new KeyInstance($this->version, $payload, $this->solution['fleetSid']); } /** * Streams KeyInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of KeyInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 A string that uniquely identifies the Key. */ 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]'; } } Preview/DeployedDevices/Fleet/DeviceInstance.php 0000644 00000011462 15107452350 0015677 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $url * @property string $uniqueName * @property string $friendlyName * @property string $fleetSid * @property bool $enabled * @property string $accountSid * @property string $identity * @property string $deploymentSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property \DateTime $dateAuthenticated */ class DeviceInstance extends InstanceResource { /** * Initialize the DeviceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $fleetSid The unique identifier of the Fleet. * @param string $sid A string that uniquely identifies the Device. */ public function __construct(Version $version, array $payload, string $fleetSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the DeviceInstance * * @return DeviceInstance Fetched DeviceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DeviceInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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) . ']'; } } Preview/DeployedDevices/Fleet/DeploymentList.php 0000644 00000013277 15107452350 0015775 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DeploymentList extends ListResource { /** * Construct the DeploymentList * * @param Version $version Version that contains the resource * @param string $fleetSid The unique identifier of the Fleet. */ public function __construct(Version $version, string $fleetSid) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new DeploymentInstance($this->version, $payload, $this->solution['fleetSid']); } /** * Streams DeploymentInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 A string that uniquely identifies the Deployment. */ 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]'; } } Preview/DeployedDevices/Fleet/DeviceContext.php 0000644 00000006050 15107452350 0015554 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DeviceContext extends InstanceContext { /** * Initialize the DeviceContext * * @param Version $version Version that contains the resource * @param string $fleetSid The fleet_sid * @param string $sid A string that uniquely identifies the Device. */ public function __construct(Version $version, $fleetSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['fleetSid' => $fleetSid, 'sid' => $sid, ]; $this->uri = '/Fleets/' . \rawurlencode($fleetSid) . '/Devices/' . \rawurlencode($sid) . ''; } /** * Fetch the DeviceInstance * * @return DeviceInstance Fetched DeviceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DeviceInstance { $payload = $this->version->fetch('GET', $this->uri); return new DeviceInstance( $this->version, $payload, $this->solution['fleetSid'], $this->solution['sid'] ); } /** * Delete the DeviceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the DeviceInstance * * @param array|Options $options Optional Arguments * @return DeviceInstance Updated DeviceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): DeviceInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'Identity' => $options['identity'], 'DeploymentSid' => $options['deploymentSid'], 'Enabled' => Serialize::booleanToString($options['enabled']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new DeviceInstance( $this->version, $payload, $this->solution['fleetSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.DeployedDevices.DeviceContext ' . \implode(' ', $context) . ']'; } } Preview/DeployedDevices/Fleet/DeviceOptions.php 0000644 00000021204 15107452350 0015561 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class DeviceOptions { /** * @param string $uniqueName A unique, addressable name of this Device. * @param string $friendlyName A human readable description for this Device. * @param string $identity An identifier of the Device user. * @param string $deploymentSid The unique SID of the Deployment group. * @param bool $enabled The enabled * @return CreateDeviceOptions Options builder */ public static function create(string $uniqueName = Values::NONE, string $friendlyName = Values::NONE, string $identity = Values::NONE, string $deploymentSid = Values::NONE, bool $enabled = Values::NONE): CreateDeviceOptions { return new CreateDeviceOptions($uniqueName, $friendlyName, $identity, $deploymentSid, $enabled); } /** * @param string $deploymentSid Find all Devices grouped under the specified * Deployment. * @return ReadDeviceOptions Options builder */ public static function read(string $deploymentSid = Values::NONE): ReadDeviceOptions { return new ReadDeviceOptions($deploymentSid); } /** * @param string $friendlyName A human readable description for this Device. * @param string $identity An identifier of the Device user. * @param string $deploymentSid The unique SID of the Deployment group. * @param bool $enabled The enabled * @return UpdateDeviceOptions Options builder */ public static function update(string $friendlyName = Values::NONE, string $identity = Values::NONE, string $deploymentSid = Values::NONE, bool $enabled = Values::NONE): UpdateDeviceOptions { return new UpdateDeviceOptions($friendlyName, $identity, $deploymentSid, $enabled); } } class CreateDeviceOptions extends Options { /** * @param string $uniqueName A unique, addressable name of this Device. * @param string $friendlyName A human readable description for this Device. * @param string $identity An identifier of the Device user. * @param string $deploymentSid The unique SID of the Deployment group. * @param bool $enabled The enabled */ public function __construct(string $uniqueName = Values::NONE, string $friendlyName = Values::NONE, string $identity = Values::NONE, string $deploymentSid = Values::NONE, bool $enabled = Values::NONE) { $this->options['uniqueName'] = $uniqueName; $this->options['friendlyName'] = $friendlyName; $this->options['identity'] = $identity; $this->options['deploymentSid'] = $deploymentSid; $this->options['enabled'] = $enabled; } /** * Provides a unique and addressable name to be assigned to this Device, to be used in addition to SID, up to 128 characters long. * * @param string $uniqueName A unique, addressable name of this Device. * @return $this Fluent Builder */ public function setUniqueName(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 A human readable description for this Device. * @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 An identifier of the Device user. * @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 The unique SID of the Deployment group. * @return $this Fluent Builder */ public function setDeploymentSid(string $deploymentSid): self { $this->options['deploymentSid'] = $deploymentSid; return $this; } /** * The enabled * * @param bool $enabled The 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 Find all Devices grouped under the specified * Deployment. */ 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 Find all Devices grouped under the specified * Deployment. * @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 A human readable description for this Device. * @param string $identity An identifier of the Device user. * @param string $deploymentSid The unique SID of the Deployment group. * @param bool $enabled The enabled */ public function __construct(string $friendlyName = Values::NONE, string $identity = Values::NONE, string $deploymentSid = Values::NONE, bool $enabled = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['identity'] = $identity; $this->options['deploymentSid'] = $deploymentSid; $this->options['enabled'] = $enabled; } /** * Provides a human readable descriptive text to be assigned to this Device, up to 256 characters long. * * @param string $friendlyName A human readable description for this Device. * @return $this Fluent Builder */ public function setFriendlyName(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 An identifier of the Device user. * @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 The unique SID of the Deployment group. * @return $this Fluent Builder */ public function setDeploymentSid(string $deploymentSid): self { $this->options['deploymentSid'] = $deploymentSid; return $this; } /** * The enabled * * @param bool $enabled The 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 . ']'; } } Preview/DeployedDevices/Fleet/KeyInstance.php 0000644 00000010622 15107452350 0015225 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $url * @property string $friendlyName * @property string $fleetSid * @property string $accountSid * @property string $deviceSid * @property string $secret * @property \DateTime $dateCreated * @property \DateTime $dateUpdated */ class KeyInstance extends InstanceResource { /** * Initialize the KeyInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $fleetSid The unique identifier of the Fleet. * @param string $sid A string that uniquely identifies the Key. */ public function __construct(Version $version, array $payload, string $fleetSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the KeyInstance * * @return KeyInstance Fetched KeyInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): KeyInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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) . ']'; } } Preview/DeployedDevices/Fleet/CertificatePage.php 0000644 00000002657 15107452350 0016040 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class CertificatePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Preview/DeployedDevices/Fleet/KeyPage.php 0000644 00000002577 15107452350 0014347 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class KeyPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Preview/DeployedDevices/Fleet/CertificateInstance.php 0000644 00000011046 15107452350 0016720 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $url * @property string $friendlyName * @property string $fleetSid * @property string $accountSid * @property string $deviceSid * @property string $thumbprint * @property \DateTime $dateCreated * @property \DateTime $dateUpdated */ class CertificateInstance extends InstanceResource { /** * Initialize the CertificateInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $fleetSid The unique identifier of the Fleet. * @param string $sid A string that uniquely identifies the Certificate. */ public function __construct(Version $version, array $payload, string $fleetSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the CertificateInstance * * @return CertificateInstance Fetched CertificateInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CertificateInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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) . ']'; } } Preview/DeployedDevices/Fleet/DevicePage.php 0000644 00000002621 15107452350 0015004 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DevicePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Preview/DeployedDevices/Fleet/CertificateContext.php 0000644 00000005740 15107452350 0016604 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class CertificateContext extends InstanceContext { /** * Initialize the CertificateContext * * @param Version $version Version that contains the resource * @param string $fleetSid The fleet_sid * @param string $sid A string that uniquely identifies the Certificate. */ public function __construct(Version $version, $fleetSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['fleetSid' => $fleetSid, 'sid' => $sid, ]; $this->uri = '/Fleets/' . \rawurlencode($fleetSid) . '/Certificates/' . \rawurlencode($sid) . ''; } /** * Fetch the CertificateInstance * * @return CertificateInstance Fetched CertificateInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CertificateInstance { $payload = $this->version->fetch('GET', $this->uri); return new CertificateInstance( $this->version, $payload, $this->solution['fleetSid'], $this->solution['sid'] ); } /** * Delete the CertificateInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the CertificateInstance * * @param array|Options $options Optional Arguments * @return CertificateInstance Updated CertificateInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): CertificateInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'DeviceSid' => $options['deviceSid'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new CertificateInstance( $this->version, $payload, $this->solution['fleetSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.DeployedDevices.CertificateContext ' . \implode(' ', $context) . ']'; } } Preview/DeployedDevices/FleetList.php 0000644 00000012426 15107452350 0013650 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FleetList extends ListResource { /** * Construct the FleetList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new FleetInstance($this->version, $payload); } /** * Streams FleetInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 A string that uniquely identifies the Fleet. */ 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]'; } } Preview/DeployedDevices/FleetPage.php 0000644 00000002542 15107452350 0013607 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FleetPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Preview/DeployedDevices/FleetInstance.php 0000644 00000012246 15107452350 0014501 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Preview\DeployedDevices\Fleet\CertificateList; use Twilio\Rest\Preview\DeployedDevices\Fleet\DeploymentList; use Twilio\Rest\Preview\DeployedDevices\Fleet\DeviceList; use Twilio\Rest\Preview\DeployedDevices\Fleet\KeyList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $url * @property string $uniqueName * @property string $friendlyName * @property string $accountSid * @property string $defaultDeploymentSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property array $links */ class FleetInstance extends InstanceResource { protected $_devices; protected $_deployments; protected $_certificates; protected $_keys; /** * Initialize the FleetInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid A string that uniquely identifies the Fleet. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the FleetInstance * * @return FleetInstance Fetched FleetInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FleetInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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 devices */ protected function getDevices(): DeviceList { return $this->proxy()->devices; } /** * Access the deployments */ protected function getDeployments(): DeploymentList { return $this->proxy()->deployments; } /** * Access the certificates */ protected function getCertificates(): CertificateList { return $this->proxy()->certificates; } /** * Access the keys */ protected function getKeys(): KeyList { return $this->proxy()->keys; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Preview/DeployedDevices/FleetContext.php 0000644 00000013175 15107452350 0014363 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Preview\DeployedDevices\Fleet\CertificateList; use Twilio\Rest\Preview\DeployedDevices\Fleet\DeploymentList; use Twilio\Rest\Preview\DeployedDevices\Fleet\DeviceList; use Twilio\Rest\Preview\DeployedDevices\Fleet\KeyList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property DeviceList $devices * @property DeploymentList $deployments * @property CertificateList $certificates * @property KeyList $keys * @method \Twilio\Rest\Preview\DeployedDevices\Fleet\DeviceContext devices(string $sid) * @method \Twilio\Rest\Preview\DeployedDevices\Fleet\DeploymentContext deployments(string $sid) * @method \Twilio\Rest\Preview\DeployedDevices\Fleet\CertificateContext certificates(string $sid) * @method \Twilio\Rest\Preview\DeployedDevices\Fleet\KeyContext keys(string $sid) */ class FleetContext extends InstanceContext { protected $_devices; protected $_deployments; protected $_certificates; protected $_keys; /** * Initialize the FleetContext * * @param Version $version Version that contains the resource * @param string $sid A string that uniquely identifies the Fleet. */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); return new FleetInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the FleetInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the FleetInstance * * @param array|Options $options Optional Arguments * @return FleetInstance Updated FleetInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): FleetInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'DefaultDeploymentSid' => $options['defaultDeploymentSid'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new FleetInstance($this->version, $payload, $this->solution['sid']); } /** * Access the devices */ protected function getDevices(): DeviceList { if (!$this->_devices) { $this->_devices = new DeviceList($this->version, $this->solution['sid']); } return $this->_devices; } /** * Access the deployments */ protected function getDeployments(): DeploymentList { if (!$this->_deployments) { $this->_deployments = new DeploymentList($this->version, $this->solution['sid']); } return $this->_deployments; } /** * Access the certificates */ protected function getCertificates(): CertificateList { if (!$this->_certificates) { $this->_certificates = new CertificateList($this->version, $this->solution['sid']); } return $this->_certificates; } /** * Access the keys */ protected function getKeys(): KeyList { if (!$this->_keys) { $this->_keys = new KeyList($this->version, $this->solution['sid']); } return $this->_keys; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return 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) . ']'; } } Preview/Sync/Service/SyncMap/SyncMapItemPage.php 0000644 00000002771 15107452350 0015563 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncMap; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SyncMapItemPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Preview/Sync/Service/SyncMap/SyncMapPermissionPage.php 0000644 00000003035 15107452350 0017007 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncMap; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SyncMapPermissionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Preview/Sync/Service/SyncMap/SyncMapItemInstance.php 0000644 00000011527 15107452350 0016452 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncMap; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $key * @property string $accountSid * @property string $serviceSid * @property string $mapSid * @property string $url * @property string $revision * @property array $data * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $createdBy */ class SyncMapItemInstance extends InstanceResource { /** * Initialize the SyncMapItemInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The service_sid * @param string $mapSid The map_sid * @param string $key The key */ public function __construct(Version $version, array $payload, string $serviceSid, string $mapSid, string $key = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the SyncMapItemInstance * * @return SyncMapItemInstance Fetched SyncMapItemInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncMapItemInstance { return $this->proxy()->fetch(); } /** * 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); } /** * Update the SyncMapItemInstance * * @param array $data The 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) . ']'; } } Preview/Sync/Service/SyncMap/SyncMapPermissionContext.php 0000644 00000006701 15107452350 0017562 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncMap; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SyncMapPermissionContext extends InstanceContext { /** * Initialize the SyncMapPermissionContext * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $mapSid Sync Map SID or unique name. * @param string $identity Identity of the user to whom the Sync Map Permission * applies. */ public function __construct(Version $version, $serviceSid, $mapSid, $identity) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'mapSid' => $mapSid, 'identity' => $identity, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Maps/' . \rawurlencode($mapSid) . '/Permissions/' . \rawurlencode($identity) . ''; } /** * Fetch the SyncMapPermissionInstance * * @return SyncMapPermissionInstance Fetched SyncMapPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncMapPermissionInstance { $payload = $this->version->fetch('GET', $this->uri); return new SyncMapPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['identity'] ); } /** * Delete the SyncMapPermissionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the SyncMapPermissionInstance * * @param bool $read Read access. * @param bool $write Write access. * @param bool $manage Manage access. * @return SyncMapPermissionInstance Updated SyncMapPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $read, bool $write, bool $manage): SyncMapPermissionInstance { $data = Values::of([ 'Read' => Serialize::booleanToString($read), 'Write' => Serialize::booleanToString($write), 'Manage' => Serialize::booleanToString($manage), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SyncMapPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['identity'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.SyncMapPermissionContext ' . \implode(' ', $context) . ']'; } } Preview/Sync/Service/SyncMap/SyncMapItemContext.php 0000644 00000006606 15107452350 0016334 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncMap; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SyncMapItemContext extends InstanceContext { /** * Initialize the SyncMapItemContext * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $mapSid The map_sid * @param string $key The key */ public function __construct(Version $version, $serviceSid, $mapSid, $key) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'mapSid' => $mapSid, 'key' => $key, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Maps/' . \rawurlencode($mapSid) . '/Items/' . \rawurlencode($key) . ''; } /** * Fetch the SyncMapItemInstance * * @return SyncMapItemInstance Fetched SyncMapItemInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncMapItemInstance { $payload = $this->version->fetch('GET', $this->uri); return new SyncMapItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['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(['If-Match' => $options['ifMatch'], ]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * Update the SyncMapItemInstance * * @param array $data The 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(['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) . ']'; } } Preview/Sync/Service/SyncMap/SyncMapItemList.php 0000644 00000014473 15107452350 0015624 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncMap; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SyncMapItemList extends ListResource { /** * Construct the SyncMapItemList * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $mapSid The map_sid */ public function __construct(Version $version, string $serviceSid, string $mapSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'mapSid' => $mapSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Maps/' . \rawurlencode($mapSid) . '/Items'; } /** * Create the SyncMapItemInstance * * @param string $key The key * @param array $data The 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), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SyncMapItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'] ); } /** * Streams SyncMapItemInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of SyncMapItemInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 */ 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]'; } } Preview/Sync/Service/SyncMap/SyncMapPermissionList.php 0000644 00000012534 15107452350 0017052 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncMap; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SyncMapPermissionList extends ListResource { /** * Construct the SyncMapPermissionList * * @param Version $version Version that contains the resource * @param string $serviceSid Sync Service Instance SID. * @param string $mapSid Sync Map SID. */ public function __construct(Version $version, string $serviceSid, string $mapSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'mapSid' => $mapSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Maps/' . \rawurlencode($mapSid) . '/Permissions'; } /** * Streams SyncMapPermissionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 Identity of the user to whom the Sync Map Permission * applies. */ 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]'; } } Preview/Sync/Service/SyncMap/SyncMapItemOptions.php 0000644 00000011041 15107452351 0016331 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncMap; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class SyncMapItemOptions { /** * @param string $ifMatch The If-Match HTTP request header * @return DeleteSyncMapItemOptions Options builder */ public static function delete(string $ifMatch = Values::NONE): DeleteSyncMapItemOptions { return new DeleteSyncMapItemOptions($ifMatch); } /** * @param string $order The order * @param string $from The from * @param string $bounds The bounds * @return ReadSyncMapItemOptions Options builder */ public static function read(string $order = Values::NONE, string $from = Values::NONE, string $bounds = Values::NONE): ReadSyncMapItemOptions { return new ReadSyncMapItemOptions($order, $from, $bounds); } /** * @param string $ifMatch The If-Match HTTP request header * @return UpdateSyncMapItemOptions Options builder */ public static function update(string $ifMatch = Values::NONE): UpdateSyncMapItemOptions { return new UpdateSyncMapItemOptions($ifMatch); } } class DeleteSyncMapItemOptions 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.DeleteSyncMapItemOptions ' . $options . ']'; } } class ReadSyncMapItemOptions extends Options { /** * @param string $order The order * @param string $from The from * @param string $bounds The 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; } /** * The order * * @param string $order The order * @return $this Fluent Builder */ public function setOrder(string $order): self { $this->options['order'] = $order; return $this; } /** * The from * * @param string $from The from * @return $this Fluent Builder */ public function setFrom(string $from): self { $this->options['from'] = $from; return $this; } /** * The bounds * * @param string $bounds The 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 . ']'; } } Preview/Sync/Service/SyncMap/SyncMapPermissionInstance.php 0000644 00000011316 15107452351 0017701 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncMap; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $serviceSid * @property string $mapSid * @property string $identity * @property bool $read * @property bool $write * @property bool $manage * @property string $url */ class SyncMapPermissionInstance extends InstanceResource { /** * Initialize the SyncMapPermissionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid Sync Service Instance SID. * @param string $mapSid Sync Map SID. * @param string $identity Identity of the user to whom the Sync Map Permission * applies. */ public function __construct(Version $version, array $payload, string $serviceSid, string $mapSid, string $identity = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the SyncMapPermissionInstance * * @return SyncMapPermissionInstance Fetched SyncMapPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncMapPermissionInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Update the SyncMapPermissionInstance * * @param bool $read Read access. * @param bool $write Write access. * @param bool $manage Manage access. * @return SyncMapPermissionInstance Updated SyncMapPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(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) . ']'; } } Preview/Sync/Service/DocumentOptions.php 0000644 00000006041 15107452351 0014350 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class DocumentOptions { /** * @param string $uniqueName The unique_name * @param array $data The data * @return CreateDocumentOptions Options builder */ public static function create(string $uniqueName = Values::NONE, array $data = Values::ARRAY_NONE): CreateDocumentOptions { return new CreateDocumentOptions($uniqueName, $data); } /** * @param string $ifMatch The If-Match HTTP request header * @return UpdateDocumentOptions Options builder */ public static function update(string $ifMatch = Values::NONE): UpdateDocumentOptions { return new UpdateDocumentOptions($ifMatch); } } class CreateDocumentOptions extends Options { /** * @param string $uniqueName The unique_name * @param array $data The data */ public function __construct(string $uniqueName = Values::NONE, array $data = Values::ARRAY_NONE) { $this->options['uniqueName'] = $uniqueName; $this->options['data'] = $data; } /** * The unique_name * * @param string $uniqueName The unique_name * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The data * * @param array $data The 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 . ']'; } } Preview/Sync/Service/DocumentContext.php 0000644 00000011442 15107452351 0014342 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Preview\Sync\Service\Document\DocumentPermissionList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property DocumentPermissionList $documentPermissions * @method \Twilio\Rest\Preview\Sync\Service\Document\DocumentPermissionContext documentPermissions(string $identity) */ class DocumentContext extends InstanceContext { protected $_documentPermissions; /** * Initialize the DocumentContext * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $sid The sid */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Documents/' . \rawurlencode($sid) . ''; } /** * Fetch the DocumentInstance * * @return DocumentInstance Fetched DocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DocumentInstance { $payload = $this->version->fetch('GET', $this->uri); return new DocumentInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Delete the DocumentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the DocumentInstance * * @param array $data The 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(['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) . ']'; } } Preview/Sync/Service/SyncMapContext.php 0000644 00000011052 15107452351 0014133 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapItemList; use Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapPermissionList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property SyncMapItemList $syncMapItems * @property SyncMapPermissionList $syncMapPermissions * @method \Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapItemContext syncMapItems(string $key) * @method \Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapPermissionContext syncMapPermissions(string $identity) */ class SyncMapContext extends InstanceContext { protected $_syncMapItems; protected $_syncMapPermissions; /** * Initialize the SyncMapContext * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $sid The sid */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Maps/' . \rawurlencode($sid) . ''; } /** * Fetch the SyncMapInstance * * @return SyncMapInstance Fetched SyncMapInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncMapInstance { $payload = $this->version->fetch('GET', $this->uri); return new SyncMapInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Delete the SyncMapInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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) . ']'; } } Preview/Sync/Service/DocumentList.php 0000644 00000013140 15107452351 0013626 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DocumentList extends ListResource { /** * Construct the DocumentList * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid */ public function __construct(Version $version, string $serviceSid) { parent::__construct($version); // Path Solution $this->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']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new DocumentInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams DocumentInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 */ 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]'; } } Preview/Sync/Service/Document/DocumentPermissionList.php 0000644 00000012644 15107452351 0017465 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\Document; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DocumentPermissionList extends ListResource { /** * Construct the DocumentPermissionList * * @param Version $version Version that contains the resource * @param string $serviceSid Sync Service Instance SID. * @param string $documentSid Sync Document SID. */ public function __construct(Version $version, string $serviceSid, string $documentSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'documentSid' => $documentSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Documents/' . \rawurlencode($documentSid) . '/Permissions'; } /** * Streams DocumentPermissionInstance records from the API as a generator * stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 Identity of the user to whom the Sync Document * Permission applies. */ 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]'; } } Preview/Sync/Service/Document/DocumentPermissionContext.php 0000644 00000007057 15107452351 0020200 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\Document; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DocumentPermissionContext extends InstanceContext { /** * Initialize the DocumentPermissionContext * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $documentSid Sync Document SID or unique name. * @param string $identity Identity of the user to whom the Sync Document * Permission applies. */ public function __construct(Version $version, $serviceSid, $documentSid, $identity) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'documentSid' => $documentSid, 'identity' => $identity, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Documents/' . \rawurlencode($documentSid) . '/Permissions/' . \rawurlencode($identity) . ''; } /** * Fetch the DocumentPermissionInstance * * @return DocumentPermissionInstance Fetched DocumentPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DocumentPermissionInstance { $payload = $this->version->fetch('GET', $this->uri); return new DocumentPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['documentSid'], $this->solution['identity'] ); } /** * Delete the DocumentPermissionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the DocumentPermissionInstance * * @param bool $read Read access. * @param bool $write Write access. * @param bool $manage Manage access. * @return DocumentPermissionInstance Updated DocumentPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $read, bool $write, bool $manage): DocumentPermissionInstance { $data = Values::of([ 'Read' => Serialize::booleanToString($read), 'Write' => Serialize::booleanToString($write), 'Manage' => Serialize::booleanToString($manage), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new DocumentPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['documentSid'], $this->solution['identity'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.DocumentPermissionContext ' . \implode(' ', $context) . ']'; } } Preview/Sync/Service/Document/DocumentPermissionPage.php 0000644 00000003052 15107452351 0017417 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\Document; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DocumentPermissionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Preview/Sync/Service/Document/DocumentPermissionInstance.php 0000644 00000011421 15107452351 0020306 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\Document; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $serviceSid * @property string $documentSid * @property string $identity * @property bool $read * @property bool $write * @property bool $manage * @property string $url */ class DocumentPermissionInstance extends InstanceResource { /** * Initialize the DocumentPermissionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid Sync Service Instance SID. * @param string $documentSid Sync Document SID. * @param string $identity Identity of the user to whom the Sync Document * Permission applies. */ public function __construct(Version $version, array $payload, string $serviceSid, string $documentSid, string $identity = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the DocumentPermissionInstance * * @return DocumentPermissionInstance Fetched DocumentPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DocumentPermissionInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Update the DocumentPermissionInstance * * @param bool $read Read access. * @param bool $write Write access. * @param bool $manage Manage access. * @return DocumentPermissionInstance Updated DocumentPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(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) . ']'; } } Preview/Sync/Service/SyncListPage.php 0000644 00000002602 15107452351 0013562 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SyncListPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Preview/Sync/Service/SyncListOptions.php 0000644 00000003015 15107452351 0014340 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class SyncListOptions { /** * @param string $uniqueName The unique_name * @return CreateSyncListOptions Options builder */ public static function create(string $uniqueName = Values::NONE): CreateSyncListOptions { return new CreateSyncListOptions($uniqueName); } } class CreateSyncListOptions extends Options { /** * @param string $uniqueName The unique_name */ public function __construct(string $uniqueName = Values::NONE) { $this->options['uniqueName'] = $uniqueName; } /** * The unique_name * * @param string $uniqueName The unique_name * @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 . ']'; } } Preview/Sync/Service/SyncMapInstance.php 0000644 00000011230 15107452351 0014251 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapItemList; use Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapPermissionList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $uniqueName * @property string $accountSid * @property string $serviceSid * @property string $url * @property array $links * @property string $revision * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $createdBy */ class SyncMapInstance extends InstanceResource { protected $_syncMapItems; protected $_syncMapPermissions; /** * Initialize the SyncMapInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The service_sid * @param string $sid The sid */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the SyncMapInstance * * @return SyncMapInstance Fetched SyncMapInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncMapInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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) . ']'; } } Preview/Sync/Service/SyncList/SyncListPermissionContext.php 0000644 00000006732 15107452351 0020163 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncList; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SyncListPermissionContext extends InstanceContext { /** * Initialize the SyncListPermissionContext * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $listSid Sync List SID or unique name. * @param string $identity Identity of the user to whom the Sync List * Permission applies. */ public function __construct(Version $version, $serviceSid, $listSid, $identity) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'listSid' => $listSid, 'identity' => $identity, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Lists/' . \rawurlencode($listSid) . '/Permissions/' . \rawurlencode($identity) . ''; } /** * Fetch the SyncListPermissionInstance * * @return SyncListPermissionInstance Fetched SyncListPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncListPermissionInstance { $payload = $this->version->fetch('GET', $this->uri); return new SyncListPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid'], $this->solution['identity'] ); } /** * Delete the SyncListPermissionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the SyncListPermissionInstance * * @param bool $read Read access. * @param bool $write Write access. * @param bool $manage Manage access. * @return SyncListPermissionInstance Updated SyncListPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $read, bool $write, bool $manage): SyncListPermissionInstance { $data = Values::of([ 'Read' => Serialize::booleanToString($read), 'Write' => Serialize::booleanToString($write), 'Manage' => Serialize::booleanToString($manage), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SyncListPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid'], $this->solution['identity'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.SyncListPermissionContext ' . \implode(' ', $context) . ']'; } } Preview/Sync/Service/SyncList/SyncListPermissionPage.php 0000644 00000003046 15107452351 0017406 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncList; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SyncListPermissionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Preview/Sync/Service/SyncList/SyncListPermissionList.php 0000644 00000012600 15107452351 0017441 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncList; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SyncListPermissionList extends ListResource { /** * Construct the SyncListPermissionList * * @param Version $version Version that contains the resource * @param string $serviceSid Sync Service Instance SID. * @param string $listSid Sync List SID. */ public function __construct(Version $version, string $serviceSid, string $listSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'listSid' => $listSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Lists/' . \rawurlencode($listSid) . '/Permissions'; } /** * Streams SyncListPermissionInstance records from the API as a generator * stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 Identity of the user to whom the Sync List * Permission applies. */ 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]'; } } Preview/Sync/Service/SyncList/SyncListItemContext.php 0000644 00000006653 15107452351 0016733 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncList; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SyncListItemContext extends InstanceContext { /** * Initialize the SyncListItemContext * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $listSid The list_sid * @param int $index The index */ public function __construct(Version $version, $serviceSid, $listSid, $index) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'listSid' => $listSid, 'index' => $index, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Lists/' . \rawurlencode($listSid) . '/Items/' . \rawurlencode($index) . ''; } /** * Fetch the SyncListItemInstance * * @return SyncListItemInstance Fetched SyncListItemInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncListItemInstance { $payload = $this->version->fetch('GET', $this->uri); return new SyncListItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid'], $this->solution['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(['If-Match' => $options['ifMatch'], ]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * Update the SyncListItemInstance * * @param array $data The 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(['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) . ']'; } } Preview/Sync/Service/SyncList/SyncListItemOptions.php 0000644 00000011062 15107452351 0016730 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncList; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class SyncListItemOptions { /** * @param string $ifMatch The If-Match HTTP request header * @return DeleteSyncListItemOptions Options builder */ public static function delete(string $ifMatch = Values::NONE): DeleteSyncListItemOptions { return new DeleteSyncListItemOptions($ifMatch); } /** * @param string $order The order * @param string $from The from * @param string $bounds The bounds * @return ReadSyncListItemOptions Options builder */ public static function read(string $order = Values::NONE, string $from = Values::NONE, string $bounds = Values::NONE): ReadSyncListItemOptions { return new ReadSyncListItemOptions($order, $from, $bounds); } /** * @param string $ifMatch The If-Match HTTP request header * @return UpdateSyncListItemOptions Options builder */ public static function update(string $ifMatch = Values::NONE): UpdateSyncListItemOptions { return new UpdateSyncListItemOptions($ifMatch); } } class DeleteSyncListItemOptions 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.DeleteSyncListItemOptions ' . $options . ']'; } } class ReadSyncListItemOptions extends Options { /** * @param string $order The order * @param string $from The from * @param string $bounds The 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; } /** * The order * * @param string $order The order * @return $this Fluent Builder */ public function setOrder(string $order): self { $this->options['order'] = $order; return $this; } /** * The from * * @param string $from The from * @return $this Fluent Builder */ public function setFrom(string $from): self { $this->options['from'] = $from; return $this; } /** * The bounds * * @param string $bounds The 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 . ']'; } } Preview/Sync/Service/SyncList/SyncListItemList.php 0000644 00000014441 15107452351 0016214 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncList; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SyncListItemList extends ListResource { /** * Construct the SyncListItemList * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $listSid The list_sid */ public function __construct(Version $version, string $serviceSid, string $listSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'listSid' => $listSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Lists/' . \rawurlencode($listSid) . '/Items'; } /** * Create the SyncListItemInstance * * @param array $data The 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), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SyncListItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid'] ); } /** * Streams SyncListItemInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of SyncListItemInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 */ 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]'; } } Preview/Sync/Service/SyncList/SyncListItemPage.php 0000644 00000003002 15107452351 0016144 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncList; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SyncListItemPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Preview/Sync/Service/SyncList/SyncListPermissionInstance.php 0000644 00000011351 15107452351 0020274 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncList; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $serviceSid * @property string $listSid * @property string $identity * @property bool $read * @property bool $write * @property bool $manage * @property string $url */ class SyncListPermissionInstance extends InstanceResource { /** * Initialize the SyncListPermissionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid Sync Service Instance SID. * @param string $listSid Sync List SID. * @param string $identity Identity of the user to whom the Sync List * Permission applies. */ public function __construct(Version $version, array $payload, string $serviceSid, string $listSid, string $identity = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the SyncListPermissionInstance * * @return SyncListPermissionInstance Fetched SyncListPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncListPermissionInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Update the SyncListPermissionInstance * * @param bool $read Read access. * @param bool $write Write access. * @param bool $manage Manage access. * @return SyncListPermissionInstance Updated SyncListPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(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) . ']'; } } Preview/Sync/Service/SyncList/SyncListItemInstance.php 0000644 00000011574 15107452351 0017051 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncList; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property int $index * @property string $accountSid * @property string $serviceSid * @property string $listSid * @property string $url * @property string $revision * @property array $data * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $createdBy */ class SyncListItemInstance extends InstanceResource { /** * Initialize the SyncListItemInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The service_sid * @param string $listSid The list_sid * @param int $index The index */ public function __construct(Version $version, array $payload, string $serviceSid, string $listSid, int $index = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the SyncListItemInstance * * @return SyncListItemInstance Fetched SyncListItemInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncListItemInstance { return $this->proxy()->fetch(); } /** * 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); } /** * Update the SyncListItemInstance * * @param array $data The 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) . ']'; } } Preview/Sync/Service/SyncMapList.php 0000644 00000012731 15107452351 0013427 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SyncMapList extends ListResource { /** * Construct the SyncMapList * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid */ public function __construct(Version $version, string $serviceSid) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SyncMapInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams SyncMapInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 */ 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]'; } } Preview/Sync/Service/DocumentInstance.php 0000644 00000011660 15107452351 0014464 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Preview\Sync\Service\Document\DocumentPermissionList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $uniqueName * @property string $accountSid * @property string $serviceSid * @property string $url * @property array $links * @property string $revision * @property array $data * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $createdBy */ class DocumentInstance extends InstanceResource { protected $_documentPermissions; /** * Initialize the DocumentInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The service_sid * @param string $sid The sid */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the DocumentInstance * * @return DocumentInstance Fetched DocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DocumentInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Update the DocumentInstance * * @param array $data The 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) . ']'; } } Preview/Sync/Service/DocumentPage.php 0000644 00000002602 15107452351 0013570 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DocumentPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Preview/Sync/Service/SyncListInstance.php 0000644 00000011262 15107452351 0014454 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Rest\Preview\Sync\Service\SyncList\SyncListItemList; use Twilio\Rest\Preview\Sync\Service\SyncList\SyncListPermissionList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $uniqueName * @property string $accountSid * @property string $serviceSid * @property string $url * @property array $links * @property string $revision * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $createdBy */ class SyncListInstance extends InstanceResource { protected $_syncListItems; protected $_syncListPermissions; /** * Initialize the SyncListInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The service_sid * @param string $sid The sid */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the SyncListInstance * * @return SyncListInstance Fetched SyncListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncListInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Access the syncListItems */ protected function getSyncListItems(): SyncListItemList { return $this->proxy()->syncListItems; } /** * Access the syncListPermissions */ protected function getSyncListPermissions(): SyncListPermissionList { return $this->proxy()->syncListPermissions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Preview/Sync/Service/SyncListList.php 0000644 00000012762 15107452351 0013631 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SyncListList extends ListResource { /** * Construct the SyncListList * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid */ public function __construct(Version $version, string $serviceSid) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SyncListInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams SyncListInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 */ 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]'; } } Preview/Sync/Service/SyncMapPage.php 0000644 00000002574 15107452351 0013374 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SyncMapPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Preview/Sync/Service/SyncListContext.php 0000644 00000011121 15107452351 0014326 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Preview\Sync\Service\SyncList\SyncListItemList; use Twilio\Rest\Preview\Sync\Service\SyncList\SyncListPermissionList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property SyncListItemList $syncListItems * @property SyncListPermissionList $syncListPermissions * @method \Twilio\Rest\Preview\Sync\Service\SyncList\SyncListItemContext syncListItems(int $index) * @method \Twilio\Rest\Preview\Sync\Service\SyncList\SyncListPermissionContext syncListPermissions(string $identity) */ class SyncListContext extends InstanceContext { protected $_syncListItems; protected $_syncListPermissions; /** * Initialize the SyncListContext * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $sid The sid */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Lists/' . \rawurlencode($sid) . ''; } /** * Fetch the SyncListInstance * * @return SyncListInstance Fetched SyncListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncListInstance { $payload = $this->version->fetch('GET', $this->uri); return new SyncListInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Delete the SyncListInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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; } /** * 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; } /** * 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) . ']'; } } Preview/Sync/Service/SyncMapOptions.php 0000644 00000003007 15107452351 0014143 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class SyncMapOptions { /** * @param string $uniqueName The unique_name * @return CreateSyncMapOptions Options builder */ public static function create(string $uniqueName = Values::NONE): CreateSyncMapOptions { return new CreateSyncMapOptions($uniqueName); } } class CreateSyncMapOptions extends Options { /** * @param string $uniqueName The unique_name */ public function __construct(string $uniqueName = Values::NONE) { $this->options['uniqueName'] = $uniqueName; } /** * The unique_name * * @param string $uniqueName The unique_name * @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 . ']'; } } Preview/Sync/ServiceInstance.php 0000644 00000012005 15107452351 0012700 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Preview\Sync\Service\DocumentList; use Twilio\Rest\Preview\Sync\Service\SyncListList; use Twilio\Rest\Preview\Sync\Service\SyncMapList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $accountSid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property string $webhookUrl * @property bool $reachabilityWebhooksEnabled * @property bool $aclEnabled * @property array $links */ class ServiceInstance extends InstanceResource { protected $_documents; protected $_syncLists; protected $_syncMaps; /** * Initialize the ServiceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The sid */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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 documents */ protected function getDocuments(): DocumentList { return $this->proxy()->documents; } /** * Access the syncLists */ protected function getSyncLists(): SyncListList { return $this->proxy()->syncLists; } /** * 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.Preview.Sync.ServiceInstance ' . \implode(' ', $context) . ']'; } } Preview/Sync/ServiceList.php 0000644 00000013056 15107452351 0012056 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ServiceList extends ListResource { /** * Construct the ServiceList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ServiceInstance($this->version, $payload); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 */ 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]'; } } Preview/Sync/ServiceContext.php 0000644 00000012420 15107452351 0012561 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Preview\Sync\Service\DocumentList; use Twilio\Rest\Preview\Sync\Service\SyncListList; use Twilio\Rest\Preview\Sync\Service\SyncMapList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property DocumentList $documents * @property SyncListList $syncLists * @property SyncMapList $syncMaps * @method \Twilio\Rest\Preview\Sync\Service\DocumentContext documents(string $sid) * @method \Twilio\Rest\Preview\Sync\Service\SyncListContext syncLists(string $sid) * @method \Twilio\Rest\Preview\Sync\Service\SyncMapContext syncMaps(string $sid) */ class ServiceContext extends InstanceContext { protected $_documents; protected $_syncLists; protected $_syncMaps; /** * Initialize the ServiceContext * * @param Version $version Version that contains the resource * @param string $sid The sid */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($sid) . ''; } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { $payload = $this->version->fetch('GET', $this->uri); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(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']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Access the documents */ protected function getDocuments(): DocumentList { if (!$this->_documents) { $this->_documents = new DocumentList($this->version, $this->solution['sid']); } return $this->_documents; } /** * 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; } /** * 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) . ']'; } } Preview/Sync/ServiceOptions.php 0000644 00000014153 15107452351 0012575 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class ServiceOptions { /** * @param string $friendlyName The friendly_name * @param string $webhookUrl The webhook_url * @param bool $reachabilityWebhooksEnabled The reachability_webhooks_enabled * @param bool $aclEnabled The acl_enabled * @return CreateServiceOptions Options builder */ public static function create(string $friendlyName = Values::NONE, string $webhookUrl = Values::NONE, bool $reachabilityWebhooksEnabled = Values::NONE, bool $aclEnabled = Values::NONE): CreateServiceOptions { return new CreateServiceOptions($friendlyName, $webhookUrl, $reachabilityWebhooksEnabled, $aclEnabled); } /** * @param string $webhookUrl The webhook_url * @param string $friendlyName The friendly_name * @param bool $reachabilityWebhooksEnabled The reachability_webhooks_enabled * @param bool $aclEnabled The acl_enabled * @return UpdateServiceOptions Options builder */ public static function update(string $webhookUrl = Values::NONE, string $friendlyName = Values::NONE, bool $reachabilityWebhooksEnabled = Values::NONE, bool $aclEnabled = Values::NONE): UpdateServiceOptions { return new UpdateServiceOptions($webhookUrl, $friendlyName, $reachabilityWebhooksEnabled, $aclEnabled); } } class CreateServiceOptions extends Options { /** * @param string $friendlyName The friendly_name * @param string $webhookUrl The webhook_url * @param bool $reachabilityWebhooksEnabled The reachability_webhooks_enabled * @param bool $aclEnabled The acl_enabled */ public function __construct(string $friendlyName = Values::NONE, string $webhookUrl = Values::NONE, bool $reachabilityWebhooksEnabled = Values::NONE, bool $aclEnabled = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['webhookUrl'] = $webhookUrl; $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; $this->options['aclEnabled'] = $aclEnabled; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The webhook_url * * @param string $webhookUrl The webhook_url * @return $this Fluent Builder */ public function setWebhookUrl(string $webhookUrl): self { $this->options['webhookUrl'] = $webhookUrl; return $this; } /** * The reachability_webhooks_enabled * * @param bool $reachabilityWebhooksEnabled The reachability_webhooks_enabled * @return $this Fluent Builder */ public function setReachabilityWebhooksEnabled(bool $reachabilityWebhooksEnabled): self { $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; return $this; } /** * The acl_enabled * * @param bool $aclEnabled The acl_enabled * @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 The webhook_url * @param string $friendlyName The friendly_name * @param bool $reachabilityWebhooksEnabled The reachability_webhooks_enabled * @param bool $aclEnabled The acl_enabled */ public function __construct(string $webhookUrl = Values::NONE, string $friendlyName = Values::NONE, bool $reachabilityWebhooksEnabled = Values::NONE, bool $aclEnabled = Values::NONE) { $this->options['webhookUrl'] = $webhookUrl; $this->options['friendlyName'] = $friendlyName; $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; $this->options['aclEnabled'] = $aclEnabled; } /** * The webhook_url * * @param string $webhookUrl The webhook_url * @return $this Fluent Builder */ public function setWebhookUrl(string $webhookUrl): self { $this->options['webhookUrl'] = $webhookUrl; return $this; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The reachability_webhooks_enabled * * @param bool $reachabilityWebhooksEnabled The reachability_webhooks_enabled * @return $this Fluent Builder */ public function setReachabilityWebhooksEnabled(bool $reachabilityWebhooksEnabled): self { $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; return $this; } /** * The acl_enabled * * @param bool $aclEnabled The acl_enabled * @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 . ']'; } } Preview/Sync/ServicePage.php 0000644 00000002515 15107452351 0012015 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ServicePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Preview/Sync.php 0000644 00000004261 15107452351 0007620 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Preview\Sync\ServiceList; use Twilio\Version; /** * @property ServiceList $services * @method \Twilio\Rest\Preview\Sync\ServiceContext services(string $sid) */ class Sync extends Version { protected $_services; /** * Construct the Sync version of Preview * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->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]'; } } Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionInstance.php 0000644 00000010746 15107452351 0022175 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace\InstalledAddOn; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $installedAddOnSid * @property string $friendlyName * @property string $productName * @property string $uniqueName * @property bool $enabled * @property string $url */ class InstalledAddOnExtensionInstance extends InstanceResource { /** * Initialize the InstalledAddOnExtensionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $installedAddOnSid The SID of the InstalledAddOn resource to * which this extension applies * @param string $sid The SID of the InstalledAddOn Extension resource to fetch */ public function __construct(Version $version, array $payload, string $installedAddOnSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionPage.php 0000644 00000003064 15107452351 0021300 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace\InstalledAddOn; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class InstalledAddOnExtensionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionList.php 0000644 00000012647 15107452351 0021346 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace\InstalledAddOn; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class InstalledAddOnExtensionList extends ListResource { /** * Construct the InstalledAddOnExtensionList * * @param Version $version Version that contains the resource * @param string $installedAddOnSid The SID of the InstalledAddOn resource to * which this extension applies */ public function __construct(Version $version, string $installedAddOnSid) { parent::__construct($version); // Path Solution $this->solution = ['installedAddOnSid' => $installedAddOnSid, ]; $this->uri = '/InstalledAddOns/' . \rawurlencode($installedAddOnSid) . '/Extensions'; } /** * Streams InstalledAddOnExtensionInstance records from the API as a generator * stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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]'; } } Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionContext.php 0000644 00000006006 15107452351 0022047 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace\InstalledAddOn; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class InstalledAddOnExtensionContext extends InstanceContext { /** * Initialize the InstalledAddOnExtensionContext * * @param Version $version Version that contains the resource * @param string $installedAddOnSid The SID of the InstalledAddOn resource with * the extension to fetch * @param string $sid The SID of the InstalledAddOn Extension resource to fetch */ public function __construct(Version $version, $installedAddOnSid, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new InstalledAddOnExtensionInstance( $this->version, $payload, $this->solution['installedAddOnSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Marketplace.InstalledAddOnExtensionContext ' . \implode(' ', $context) . ']'; } } Preview/Marketplace/InstalledAddOnPage.php 0000644 00000002614 15107452351 0014556 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class InstalledAddOnPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Preview/Marketplace/InstalledAddOnContext.php 0000644 00000010720 15107452351 0015323 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Preview\Marketplace\InstalledAddOn\InstalledAddOnExtensionList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property InstalledAddOnExtensionList $extensions * @method \Twilio\Rest\Preview\Marketplace\InstalledAddOn\InstalledAddOnExtensionContext extensions(string $sid) */ class InstalledAddOnContext extends InstanceContext { protected $_extensions; /** * Initialize the InstalledAddOnContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the InstalledAddOn resource to fetch */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->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 { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the InstalledAddOnInstance * * @return InstalledAddOnInstance Fetched InstalledAddOnInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): InstalledAddOnInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } Preview/Marketplace/InstalledAddOnList.php 0000644 00000013726 15107452351 0014623 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class InstalledAddOnList extends ListResource { /** * Construct the InstalledAddOnList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new InstalledAddOnInstance($this->version, $payload); } /** * Streams InstalledAddOnInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 fetch */ 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]'; } } Preview/Marketplace/AvailableAddOnList.php 0000644 00000011550 15107452351 0014555 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AvailableAddOnList extends ListResource { /** * Construct the AvailableAddOnList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/AvailableAddOns'; } /** * Streams AvailableAddOnInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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]'; } } Preview/Marketplace/AvailableAddOnInstance.php 0000644 00000007353 15107452351 0015414 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Rest\Preview\Marketplace\AvailableAddOn\AvailableAddOnExtensionList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $friendlyName * @property string $description * @property string $pricingType * @property array $configurationSchema * @property string $url * @property array $links */ class AvailableAddOnInstance extends InstanceResource { protected $_extensions; /** * Initialize the AvailableAddOnInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the AvailableAddOn resource to fetch */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Preview/Marketplace/AvailableAddOnPage.php 0000644 00000002614 15107452351 0014517 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AvailableAddOnPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Preview/Marketplace/AvailableAddOnContext.php 0000644 00000006675 15107452351 0015302 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Preview\Marketplace\AvailableAddOn\AvailableAddOnExtensionList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property AvailableAddOnExtensionList $extensions * @method \Twilio\Rest\Preview\Marketplace\AvailableAddOn\AvailableAddOnExtensionContext extensions(string $sid) */ class AvailableAddOnContext extends InstanceContext { protected $_extensions; /** * Initialize the AvailableAddOnContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the AvailableAddOn resource to fetch */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionList.php 0000644 00000012647 15107452351 0021250 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace\AvailableAddOn; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AvailableAddOnExtensionList extends ListResource { /** * Construct the AvailableAddOnExtensionList * * @param Version $version Version that contains the resource * @param string $availableAddOnSid The SID of the AvailableAddOn resource to * which this extension applies */ public function __construct(Version $version, string $availableAddOnSid) { parent::__construct($version); // Path Solution $this->solution = ['availableAddOnSid' => $availableAddOnSid, ]; $this->uri = '/AvailableAddOns/' . \rawurlencode($availableAddOnSid) . '/Extensions'; } /** * Streams AvailableAddOnExtensionInstance records from the API as a generator * stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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]'; } } Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionContext.php 0000644 00000004352 15107452351 0021753 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace\AvailableAddOn; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AvailableAddOnExtensionContext extends InstanceContext { /** * Initialize the AvailableAddOnExtensionContext * * @param Version $version Version that contains the resource * @param string $availableAddOnSid The SID of the AvailableAddOn resource with * the extension to fetch * @param string $sid The SID of the AvailableAddOn Extension resource to fetch */ public function __construct(Version $version, $availableAddOnSid, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionPage.php 0000644 00000003064 15107452351 0021202 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace\AvailableAddOn; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AvailableAddOnExtensionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionInstance.php 0000644 00000007670 15107452351 0022101 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace\AvailableAddOn; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $availableAddOnSid * @property string $friendlyName * @property string $productName * @property string $uniqueName * @property string $url */ class AvailableAddOnExtensionInstance extends InstanceResource { /** * Initialize the AvailableAddOnExtensionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $availableAddOnSid The SID of the AvailableAddOn resource to * which this extension applies * @param string $sid The SID of the AvailableAddOn Extension resource to fetch */ public function __construct(Version $version, array $payload, string $availableAddOnSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Preview/Marketplace/InstalledAddOnOptions.php 0000644 00000011532 15107452351 0015334 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class InstalledAddOnOptions { /** * @param array $configuration The JSON object representing the configuration * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return CreateInstalledAddOnOptions Options builder */ public static function create(array $configuration = Values::ARRAY_NONE, string $uniqueName = Values::NONE): CreateInstalledAddOnOptions { return new CreateInstalledAddOnOptions($configuration, $uniqueName); } /** * @param array $configuration The JSON object representing the configuration * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return UpdateInstalledAddOnOptions Options builder */ public static function update(array $configuration = Values::ARRAY_NONE, string $uniqueName = Values::NONE): UpdateInstalledAddOnOptions { return new UpdateInstalledAddOnOptions($configuration, $uniqueName); } } class CreateInstalledAddOnOptions extends Options { /** * @param array $configuration The JSON object representing the configuration * @param string $uniqueName An application-defined string that uniquely * identifies the resource */ public function __construct(array $configuration = Values::ARRAY_NONE, string $uniqueName = Values::NONE) { $this->options['configuration'] = $configuration; $this->options['uniqueName'] = $uniqueName; } /** * The JSON object that represents the configuration of the new Add-on being installed. * * @param array $configuration The JSON object representing the configuration * @return $this Fluent Builder */ public function setConfiguration(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 * @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 The JSON object representing the configuration * @param string $uniqueName An application-defined string that uniquely * identifies the resource */ 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 The JSON object representing the configuration * @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 * @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 . ']'; } } Preview/Marketplace/InstalledAddOnInstance.php 0000644 00000011370 15107452351 0015445 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Preview\Marketplace\InstalledAddOn\InstalledAddOnExtensionList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $accountSid * @property string $friendlyName * @property string $description * @property array $configuration * @property string $uniqueName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class InstalledAddOnInstance extends InstanceResource { protected $_extensions; /** * Initialize the InstalledAddOnInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the InstalledAddOn resource to fetch */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Preview/Understand.php 0000644 00000004355 15107452351 0011017 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Preview\Understand\AssistantList; use Twilio\Version; /** * @property AssistantList $assistants * @method \Twilio\Rest\Preview\Understand\AssistantContext assistants(string $sid) */ class Understand extends Version { protected $_assistants; /** * Construct the Understand version of Preview * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'understand'; } protected function getAssistants(): AssistantList { if (!$this->_assistants) { $this->_assistants = new AssistantList($this); } return $this->_assistants; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(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.Understand]'; } } Preview/Understand/Assistant/AssistantInitiationActionsList.php 0000644 00000002541 15107452351 0021141 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AssistantInitiationActionsList extends ListResource { /** * Construct the AssistantInitiationActionsList * * @param Version $version Version that contains the resource * @param string $assistantSid The assistant_sid */ public function __construct(Version $version, string $assistantSid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, ]; } /** * Constructs a AssistantInitiationActionsContext */ public function getContext(): AssistantInitiationActionsContext { return new AssistantInitiationActionsContext($this->version, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Understand.AssistantInitiationActionsList]'; } } Preview/Understand/Assistant/AssistantFallbackActionsOptions.php 0000644 00000003321 15107452351 0021246 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class AssistantFallbackActionsOptions { /** * @param array $fallbackActions The fallback_actions * @return UpdateAssistantFallbackActionsOptions Options builder */ public static function update(array $fallbackActions = Values::ARRAY_NONE): UpdateAssistantFallbackActionsOptions { return new UpdateAssistantFallbackActionsOptions($fallbackActions); } } class UpdateAssistantFallbackActionsOptions extends Options { /** * @param array $fallbackActions The fallback_actions */ public function __construct(array $fallbackActions = Values::ARRAY_NONE) { $this->options['fallbackActions'] = $fallbackActions; } /** * The fallback_actions * * @param array $fallbackActions The fallback_actions * @return $this Fluent Builder */ public function setFallbackActions(array $fallbackActions): self { $this->options['fallbackActions'] = $fallbackActions; return $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.Understand.UpdateAssistantFallbackActionsOptions ' . $options . ']'; } } Preview/Understand/Assistant/ModelBuildOptions.php 0000644 00000011115 15107452351 0016354 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class ModelBuildOptions { /** * @param string $statusCallback The status_callback * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. For example: v0.1 * @return CreateModelBuildOptions Options builder */ public static function create(string $statusCallback = Values::NONE, string $uniqueName = Values::NONE): CreateModelBuildOptions { return new CreateModelBuildOptions($statusCallback, $uniqueName); } /** * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. For example: v0.1 * @return UpdateModelBuildOptions Options builder */ public static function update(string $uniqueName = Values::NONE): UpdateModelBuildOptions { return new UpdateModelBuildOptions($uniqueName); } } class CreateModelBuildOptions extends Options { /** * @param string $statusCallback The status_callback * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. For example: v0.1 */ public function __construct(string $statusCallback = Values::NONE, string $uniqueName = Values::NONE) { $this->options['statusCallback'] = $statusCallback; $this->options['uniqueName'] = $uniqueName; } /** * The status_callback * * @param string $statusCallback The status_callback * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. For example: v0.1 * * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. For example: v0.1 * @return $this Fluent Builder */ public function setUniqueName(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.Understand.CreateModelBuildOptions ' . $options . ']'; } } class UpdateModelBuildOptions extends Options { /** * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. For example: v0.1 */ public function __construct(string $uniqueName = Values::NONE) { $this->options['uniqueName'] = $uniqueName; } /** * A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. For example: v0.1 * * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. For example: v0.1 * @return $this Fluent Builder */ public function setUniqueName(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.Understand.UpdateModelBuildOptions ' . $options . ']'; } } Preview/Understand/Assistant/FieldTypeInstance.php 0000644 00000011344 15107452351 0016336 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Preview\Understand\Assistant\FieldType\FieldValueList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property array $links * @property string $assistantSid * @property string $sid * @property string $uniqueName * @property string $url */ class FieldTypeInstance extends InstanceResource { protected $_fieldValues; /** * Initialize the FieldTypeInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The unique ID of the Assistant. * @param string $sid The sid */ public function __construct(Version $version, array $payload, string $assistantSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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'), 'links' => Values::array_get($payload, 'links'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['assistantSid' => $assistantSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return FieldTypeContext Context for this FieldTypeInstance */ protected function proxy(): FieldTypeContext { if (!$this->context) { $this->context = new FieldTypeContext( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the FieldTypeInstance * * @return FieldTypeInstance Fetched FieldTypeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FieldTypeInstance { return $this->proxy()->fetch(); } /** * Update the FieldTypeInstance * * @param array|Options $options Optional Arguments * @return FieldTypeInstance Updated FieldTypeInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): FieldTypeInstance { return $this->proxy()->update($options); } /** * Delete the FieldTypeInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Access the fieldValues */ protected function getFieldValues(): FieldValueList { return $this->proxy()->fieldValues; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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.Understand.FieldTypeInstance ' . \implode(' ', $context) . ']'; } } Preview/Understand/Assistant/DialogueContext.php 0000644 00000003615 15107452351 0016064 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DialogueContext extends InstanceContext { /** * Initialize the DialogueContext * * @param Version $version Version that contains the resource * @param string $assistantSid The assistant_sid * @param string $sid The sid */ public function __construct(Version $version, $assistantSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, 'sid' => $sid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Dialogues/' . \rawurlencode($sid) . ''; } /** * Fetch the DialogueInstance * * @return DialogueInstance Fetched DialogueInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DialogueInstance { $payload = $this->version->fetch('GET', $this->uri); return new DialogueInstance( $this->version, $payload, $this->solution['assistantSid'], $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.Understand.DialogueContext ' . \implode(' ', $context) . ']'; } } Preview/Understand/Assistant/StyleSheetList.php 0000644 00000002416 15107452351 0015711 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class StyleSheetList extends ListResource { /** * Construct the StyleSheetList * * @param Version $version Version that contains the resource * @param string $assistantSid The unique ID of the Assistant */ public function __construct(Version $version, string $assistantSid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, ]; } /** * Constructs a StyleSheetContext */ public function getContext(): StyleSheetContext { return new StyleSheetContext($this->version, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Understand.StyleSheetList]'; } } Preview/Understand/Assistant/ModelBuildInstance.php 0000644 00000011141 15107452351 0016464 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $assistantSid * @property string $sid * @property string $status * @property string $uniqueName * @property string $url * @property int $buildDuration * @property int $errorCode */ class ModelBuildInstance extends InstanceResource { /** * Initialize the ModelBuildInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The unique ID of the parent Assistant. * @param string $sid The sid */ public function __construct(Version $version, array $payload, string $assistantSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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')), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'sid' => Values::array_get($payload, 'sid'), 'status' => Values::array_get($payload, 'status'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'url' => Values::array_get($payload, 'url'), 'buildDuration' => Values::array_get($payload, 'build_duration'), 'errorCode' => Values::array_get($payload, 'error_code'), ]; $this->solution = ['assistantSid' => $assistantSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ModelBuildContext Context for this ModelBuildInstance */ protected function proxy(): ModelBuildContext { if (!$this->context) { $this->context = new ModelBuildContext( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the ModelBuildInstance * * @return ModelBuildInstance Fetched ModelBuildInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ModelBuildInstance { return $this->proxy()->fetch(); } /** * Update the ModelBuildInstance * * @param array|Options $options Optional Arguments * @return ModelBuildInstance Updated ModelBuildInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ModelBuildInstance { return $this->proxy()->update($options); } /** * Delete the ModelBuildInstance * * @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.Preview.Understand.ModelBuildInstance ' . \implode(' ', $context) . ']'; } } Preview/Understand/Assistant/QueryContext.php 0000644 00000005653 15107452351 0015444 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class QueryContext extends InstanceContext { /** * Initialize the QueryContext * * @param Version $version Version that contains the resource * @param string $assistantSid The unique ID of the Assistant. * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function __construct(Version $version, $assistantSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, 'sid' => $sid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Queries/' . \rawurlencode($sid) . ''; } /** * Fetch the QueryInstance * * @return QueryInstance Fetched QueryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): QueryInstance { $payload = $this->version->fetch('GET', $this->uri); return new QueryInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Update the QueryInstance * * @param array|Options $options Optional Arguments * @return QueryInstance Updated QueryInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): QueryInstance { $options = new Values($options); $data = Values::of(['SampleSid' => $options['sampleSid'], 'Status' => $options['status'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new QueryInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Delete the QueryInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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.Understand.QueryContext ' . \implode(' ', $context) . ']'; } } Preview/Understand/Assistant/AssistantFallbackActionsPage.php 0000644 00000003050 15107452351 0020466 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AssistantFallbackActionsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return AssistantFallbackActionsInstance \Twilio\Rest\Preview\Understand\Assistant\AssistantFallbackActionsInstance */ public function buildInstance(array $payload): AssistantFallbackActionsInstance { return new AssistantFallbackActionsInstance( $this->version, $payload, $this->solution['assistantSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Understand.AssistantFallbackActionsPage]'; } } Preview/Understand/Assistant/StyleSheetContext.php 0000644 00000004637 15107452351 0016431 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class StyleSheetContext extends InstanceContext { /** * Initialize the StyleSheetContext * * @param Version $version Version that contains the resource * @param string $assistantSid The unique ID of the Assistant */ public function __construct(Version $version, $assistantSid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/StyleSheet'; } /** * Fetch the StyleSheetInstance * * @return StyleSheetInstance Fetched StyleSheetInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): StyleSheetInstance { $payload = $this->version->fetch('GET', $this->uri); return new StyleSheetInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Update the StyleSheetInstance * * @param array|Options $options Optional Arguments * @return StyleSheetInstance Updated StyleSheetInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): StyleSheetInstance { $options = new Values($options); $data = Values::of(['StyleSheet' => Serialize::jsonObject($options['styleSheet']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new StyleSheetInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Provide 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.Understand.StyleSheetContext ' . \implode(' ', $context) . ']'; } } Preview/Understand/Assistant/TaskContext.php 0000644 00000015021 15107452351 0015227 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Preview\Understand\Assistant\Task\FieldList; use Twilio\Rest\Preview\Understand\Assistant\Task\SampleList; use Twilio\Rest\Preview\Understand\Assistant\Task\TaskActionsList; use Twilio\Rest\Preview\Understand\Assistant\Task\TaskStatisticsList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property FieldList $fields * @property SampleList $samples * @property TaskActionsList $taskActions * @property TaskStatisticsList $statistics * @method \Twilio\Rest\Preview\Understand\Assistant\Task\FieldContext fields(string $sid) * @method \Twilio\Rest\Preview\Understand\Assistant\Task\SampleContext samples(string $sid) * @method \Twilio\Rest\Preview\Understand\Assistant\Task\TaskActionsContext taskActions() * @method \Twilio\Rest\Preview\Understand\Assistant\Task\TaskStatisticsContext statistics() */ class TaskContext extends InstanceContext { protected $_fields; protected $_samples; protected $_taskActions; protected $_statistics; /** * Initialize the TaskContext * * @param Version $version Version that contains the resource * @param string $assistantSid The unique ID of the Assistant. * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function __construct(Version $version, $assistantSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, 'sid' => $sid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Tasks/' . \rawurlencode($sid) . ''; } /** * Fetch the TaskInstance * * @return TaskInstance Fetched TaskInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TaskInstance { $payload = $this->version->fetch('GET', $this->uri); return new TaskInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Update the TaskInstance * * @param array|Options $options Optional Arguments * @return TaskInstance Updated TaskInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): TaskInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'Actions' => Serialize::jsonObject($options['actions']), 'ActionsUrl' => $options['actionsUrl'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new TaskInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Delete the TaskInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Access the fields */ protected function getFields(): FieldList { if (!$this->_fields) { $this->_fields = new FieldList( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->_fields; } /** * Access the samples */ protected function getSamples(): SampleList { if (!$this->_samples) { $this->_samples = new SampleList( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->_samples; } /** * Access the taskActions */ protected function getTaskActions(): TaskActionsList { if (!$this->_taskActions) { $this->_taskActions = new TaskActionsList( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->_taskActions; } /** * Access the statistics */ protected function getStatistics(): TaskStatisticsList { if (!$this->_statistics) { $this->_statistics = new TaskStatisticsList( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->_statistics; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return 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.Understand.TaskContext ' . \implode(' ', $context) . ']'; } } Preview/Understand/Assistant/Task/TaskActionsContext.php 0000644 00000005334 15107452351 0017460 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\Task; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class TaskActionsContext extends InstanceContext { /** * Initialize the TaskActionsContext * * @param Version $version Version that contains the resource * @param string $assistantSid The unique ID of the parent Assistant. * @param string $taskSid The unique ID of the Task. */ public function __construct(Version $version, $assistantSid, $taskSid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, 'taskSid' => $taskSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Tasks/' . \rawurlencode($taskSid) . '/Actions'; } /** * Fetch the TaskActionsInstance * * @return TaskActionsInstance Fetched TaskActionsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TaskActionsInstance { $payload = $this->version->fetch('GET', $this->uri); return new TaskActionsInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Update the TaskActionsInstance * * @param array|Options $options Optional Arguments * @return TaskActionsInstance Updated TaskActionsInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): TaskActionsInstance { $options = new Values($options); $data = Values::of(['Actions' => Serialize::jsonObject($options['actions']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new TaskActionsInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Understand.TaskActionsContext ' . \implode(' ', $context) . ']'; } } Preview/Understand/Assistant/Task/TaskStatisticsPage.php 0000644 00000003036 15107452351 0017437 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\Task; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class TaskStatisticsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return TaskStatisticsInstance \Twilio\Rest\Preview\Understand\Assistant\Task\TaskStatisticsInstance */ public function buildInstance(array $payload): TaskStatisticsInstance { return new TaskStatisticsInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Understand.TaskStatisticsPage]'; } } Preview/Understand/Assistant/Task/SampleInstance.php 0000644 00000011513 15107452351 0016572 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\Task; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $taskSid * @property string $language * @property string $assistantSid * @property string $sid * @property string $taggedText * @property string $url * @property string $sourceChannel */ class SampleInstance extends InstanceResource { /** * Initialize the SampleInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The unique ID of the Assistant. * @param string $taskSid The unique ID of the Task associated with this Sample. * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function __construct(Version $version, array $payload, string $assistantSid, string $taskSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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')), 'taskSid' => Values::array_get($payload, 'task_sid'), 'language' => Values::array_get($payload, 'language'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'sid' => Values::array_get($payload, 'sid'), 'taggedText' => Values::array_get($payload, 'tagged_text'), 'url' => Values::array_get($payload, 'url'), 'sourceChannel' => Values::array_get($payload, 'source_channel'), ]; $this->solution = [ 'assistantSid' => $assistantSid, 'taskSid' => $taskSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SampleContext Context for this SampleInstance */ protected function proxy(): SampleContext { if (!$this->context) { $this->context = new SampleContext( $this->version, $this->solution['assistantSid'], $this->solution['taskSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the SampleInstance * * @return SampleInstance Fetched SampleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SampleInstance { return $this->proxy()->fetch(); } /** * Update the SampleInstance * * @param array|Options $options Optional Arguments * @return SampleInstance Updated SampleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SampleInstance { return $this->proxy()->update($options); } /** * Delete the SampleInstance * * @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.Preview.Understand.SampleInstance ' . \implode(' ', $context) . ']'; } } Preview/Understand/Assistant/Task/TaskActionsList.php 0000644 00000002714 15107452351 0016746 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\Task; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class TaskActionsList extends ListResource { /** * Construct the TaskActionsList * * @param Version $version Version that contains the resource * @param string $assistantSid The unique ID of the parent Assistant. * @param string $taskSid The unique ID of the Task. */ public function __construct(Version $version, string $assistantSid, string $taskSid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, 'taskSid' => $taskSid, ]; } /** * Constructs a TaskActionsContext */ public function getContext(): TaskActionsContext { return new TaskActionsContext( $this->version, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Understand.TaskActionsList]'; } } Preview/Understand/Assistant/Task/TaskStatisticsContext.php 0000644 00000004044 15107452351 0020207 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\Task; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class TaskStatisticsContext extends InstanceContext { /** * Initialize the TaskStatisticsContext * * @param Version $version Version that contains the resource * @param string $assistantSid The unique ID of the parent Assistant. * @param string $taskSid The unique ID of the Task associated with this Field. */ public function __construct(Version $version, $assistantSid, $taskSid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, 'taskSid' => $taskSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Tasks/' . \rawurlencode($taskSid) . '/Statistics'; } /** * Fetch the TaskStatisticsInstance * * @return TaskStatisticsInstance Fetched TaskStatisticsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TaskStatisticsInstance { $payload = $this->version->fetch('GET', $this->uri); return new TaskStatisticsInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Provide 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.Understand.TaskStatisticsContext ' . \implode(' ', $context) . ']'; } } Preview/Understand/Assistant/Task/SampleContext.php 0000644 00000006413 15107452351 0016455 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\Task; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SampleContext extends InstanceContext { /** * Initialize the SampleContext * * @param Version $version Version that contains the resource * @param string $assistantSid The unique ID of the Assistant. * @param string $taskSid The unique ID of the Task associated with this Sample. * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function __construct(Version $version, $assistantSid, $taskSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, 'taskSid' => $taskSid, 'sid' => $sid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Tasks/' . \rawurlencode($taskSid) . '/Samples/' . \rawurlencode($sid) . ''; } /** * Fetch the SampleInstance * * @return SampleInstance Fetched SampleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SampleInstance { $payload = $this->version->fetch('GET', $this->uri); return new SampleInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'], $this->solution['sid'] ); } /** * Update the SampleInstance * * @param array|Options $options Optional Arguments * @return SampleInstance Updated SampleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SampleInstance { $options = new Values($options); $data = Values::of([ 'Language' => $options['language'], 'TaggedText' => $options['taggedText'], 'SourceChannel' => $options['sourceChannel'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SampleInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'], $this->solution['sid'] ); } /** * Delete the SampleInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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.Understand.SampleContext ' . \implode(' ', $context) . ']'; } } Preview/Understand/Assistant/Task/SampleList.php 0000644 00000015230 15107452351 0015741 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\Task; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SampleList extends ListResource { /** * Construct the SampleList * * @param Version $version Version that contains the resource * @param string $assistantSid The unique ID of the Assistant. * @param string $taskSid The unique ID of the Task associated with this Sample. */ public function __construct(Version $version, string $assistantSid, string $taskSid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, 'taskSid' => $taskSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Tasks/' . \rawurlencode($taskSid) . '/Samples'; } /** * Streams SampleInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * Reads SampleInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SampleInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of SampleInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SamplePage Page of SampleInstance */ public function page(array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): SamplePage { $options = new Values($options); $params = Values::of([ 'Language' => $options['language'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SamplePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SampleInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SamplePage Page of SampleInstance */ public function getPage(string $targetUrl): SamplePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SamplePage($this->version, $response, $this->solution); } /** * Create the SampleInstance * * @param string $language An ISO language-country string of the sample. * @param string $taggedText The text example of how end-users may express this * task. The sample may contain Field tag blocks. * @param array|Options $options Optional Arguments * @return SampleInstance Created SampleInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $language, string $taggedText, array $options = []): SampleInstance { $options = new Values($options); $data = Values::of([ 'Language' => $language, 'TaggedText' => $taggedText, 'SourceChannel' => $options['sourceChannel'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SampleInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Constructs a SampleContext * * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function getContext(string $sid): SampleContext { return new SampleContext( $this->version, $this->solution['assistantSid'], $this->solution['taskSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Understand.SampleList]'; } } Preview/Understand/Assistant/Task/FieldPage.php 0000644 00000002750 15107452351 0015507 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\Task; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FieldPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return FieldInstance \Twilio\Rest\Preview\Understand\Assistant\Task\FieldInstance */ public function buildInstance(array $payload): FieldInstance { return new FieldInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Understand.FieldPage]'; } } Preview/Understand/Assistant/Task/FieldInstance.php 0000644 00000010553 15107452351 0016377 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\Task; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $fieldType * @property string $taskSid * @property string $assistantSid * @property string $sid * @property string $uniqueName * @property string $url */ class FieldInstance extends InstanceResource { /** * Initialize the FieldInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The unique ID of the parent Assistant. * @param string $taskSid The unique ID of the Task associated with this Field. * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function __construct(Version $version, array $payload, string $assistantSid, string $taskSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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')), 'fieldType' => Values::array_get($payload, 'field_type'), 'taskSid' => Values::array_get($payload, 'task_sid'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = [ 'assistantSid' => $assistantSid, 'taskSid' => $taskSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return FieldContext Context for this FieldInstance */ protected function proxy(): FieldContext { if (!$this->context) { $this->context = new FieldContext( $this->version, $this->solution['assistantSid'], $this->solution['taskSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the FieldInstance * * @return FieldInstance Fetched FieldInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FieldInstance { return $this->proxy()->fetch(); } /** * Delete the FieldInstance * * @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.Preview.Understand.FieldInstance ' . \implode(' ', $context) . ']'; } } Preview/Understand/Assistant/Task/SamplePage.php 0000644 00000002756 15107452351 0015713 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\Task; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SamplePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SampleInstance \Twilio\Rest\Preview\Understand\Assistant\Task\SampleInstance */ public function buildInstance(array $payload): SampleInstance { return new SampleInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Understand.SamplePage]'; } } Preview/Understand/Assistant/Task/FieldList.php 0000644 00000014354 15107452351 0015551 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\Task; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FieldList extends ListResource { /** * Construct the FieldList * * @param Version $version Version that contains the resource * @param string $assistantSid The unique ID of the parent Assistant. * @param string $taskSid The unique ID of the Task associated with this Field. */ public function __construct(Version $version, string $assistantSid, string $taskSid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, 'taskSid' => $taskSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Tasks/' . \rawurlencode($taskSid) . '/Fields'; } /** * Streams FieldInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * Reads FieldInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FieldInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of FieldInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return FieldPage Page of FieldInstance */ public function page($pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): FieldPage { $params = Values::of(['PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new FieldPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FieldInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return FieldPage Page of FieldInstance */ public function getPage(string $targetUrl): FieldPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FieldPage($this->version, $response, $this->solution); } /** * Create the FieldInstance * * @param string $fieldType The unique name or sid of the FieldType. It can be * any Built-in Field Type or the unique_name or sid * of a custom Field Type. * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. * @return FieldInstance Created FieldInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $fieldType, string $uniqueName): FieldInstance { $data = Values::of(['FieldType' => $fieldType, 'UniqueName' => $uniqueName, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new FieldInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Constructs a FieldContext * * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function getContext(string $sid): FieldContext { return new FieldContext( $this->version, $this->solution['assistantSid'], $this->solution['taskSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Understand.FieldList]'; } } Preview/Understand/Assistant/Task/TaskActionsInstance.php 0000644 00000007435 15107452351 0017604 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\Task; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $assistantSid * @property string $taskSid * @property string $url * @property array $data */ class TaskActionsInstance extends InstanceResource { /** * Initialize the TaskActionsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The unique ID of the parent Assistant. * @param string $taskSid The unique ID of the Task. */ public function __construct(Version $version, array $payload, string $assistantSid, string $taskSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'taskSid' => Values::array_get($payload, 'task_sid'), 'url' => Values::array_get($payload, 'url'), 'data' => Values::array_get($payload, 'data'), ]; $this->solution = ['assistantSid' => $assistantSid, 'taskSid' => $taskSid, ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return TaskActionsContext Context for this TaskActionsInstance */ protected function proxy(): TaskActionsContext { if (!$this->context) { $this->context = new TaskActionsContext( $this->version, $this->solution['assistantSid'], $this->solution['taskSid'] ); } return $this->context; } /** * Fetch the TaskActionsInstance * * @return TaskActionsInstance Fetched TaskActionsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TaskActionsInstance { return $this->proxy()->fetch(); } /** * Update the TaskActionsInstance * * @param array|Options $options Optional Arguments * @return TaskActionsInstance Updated TaskActionsInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): TaskActionsInstance { 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.Understand.TaskActionsInstance ' . \implode(' ', $context) . ']'; } } Preview/Understand/Assistant/Task/TaskActionsPage.php 0000644 00000003014 15107452351 0016701 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\Task; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class TaskActionsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return TaskActionsInstance \Twilio\Rest\Preview\Understand\Assistant\Task\TaskActionsInstance */ public function buildInstance(array $payload): TaskActionsInstance { return new TaskActionsInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Understand.TaskActionsPage]'; } } Preview/Understand/Assistant/Task/SampleOptions.php 0000644 00000016107 15107452351 0016465 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\Task; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class SampleOptions { /** * @param string $language An ISO language-country string of the sample. * @return ReadSampleOptions Options builder */ public static function read(string $language = Values::NONE): ReadSampleOptions { return new ReadSampleOptions($language); } /** * @param string $sourceChannel The communication channel the sample was * captured. It can be: voice, sms, chat, alexa, * google-assistant, or slack. If not included the * value will be null * @return CreateSampleOptions Options builder */ public static function create(string $sourceChannel = Values::NONE): CreateSampleOptions { return new CreateSampleOptions($sourceChannel); } /** * @param string $language An ISO language-country string of the sample. * @param string $taggedText The text example of how end-users may express this * task. The sample may contain Field tag blocks. * @param string $sourceChannel The communication channel the sample was * captured. It can be: voice, sms, chat, alexa, * google-assistant, or slack. If not included the * value will be null * @return UpdateSampleOptions Options builder */ public static function update(string $language = Values::NONE, string $taggedText = Values::NONE, string $sourceChannel = Values::NONE): UpdateSampleOptions { return new UpdateSampleOptions($language, $taggedText, $sourceChannel); } } class ReadSampleOptions extends Options { /** * @param string $language An ISO language-country string of the sample. */ public function __construct(string $language = Values::NONE) { $this->options['language'] = $language; } /** * An ISO language-country string of the sample. * * @param string $language An ISO language-country string of the sample. * @return $this Fluent Builder */ public function setLanguage(string $language): self { $this->options['language'] = $language; return $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.Understand.ReadSampleOptions ' . $options . ']'; } } class CreateSampleOptions extends Options { /** * @param string $sourceChannel The communication channel the sample was * captured. It can be: voice, sms, chat, alexa, * google-assistant, or slack. If not included the * value will be null */ public function __construct(string $sourceChannel = Values::NONE) { $this->options['sourceChannel'] = $sourceChannel; } /** * The communication channel the sample was captured. It can be: *voice*, *sms*, *chat*, *alexa*, *google-assistant*, or *slack*. If not included the value will be null * * @param string $sourceChannel The communication channel the sample was * captured. It can be: voice, sms, chat, alexa, * google-assistant, or slack. If not included the * value will be null * @return $this Fluent Builder */ public function setSourceChannel(string $sourceChannel): self { $this->options['sourceChannel'] = $sourceChannel; return $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.Understand.CreateSampleOptions ' . $options . ']'; } } class UpdateSampleOptions extends Options { /** * @param string $language An ISO language-country string of the sample. * @param string $taggedText The text example of how end-users may express this * task. The sample may contain Field tag blocks. * @param string $sourceChannel The communication channel the sample was * captured. It can be: voice, sms, chat, alexa, * google-assistant, or slack. If not included the * value will be null */ public function __construct(string $language = Values::NONE, string $taggedText = Values::NONE, string $sourceChannel = Values::NONE) { $this->options['language'] = $language; $this->options['taggedText'] = $taggedText; $this->options['sourceChannel'] = $sourceChannel; } /** * An ISO language-country string of the sample. * * @param string $language An ISO language-country string of the sample. * @return $this Fluent Builder */ public function setLanguage(string $language): self { $this->options['language'] = $language; return $this; } /** * The text example of how end-users may express this task. The sample may contain Field tag blocks. * * @param string $taggedText The text example of how end-users may express this * task. The sample may contain Field tag blocks. * @return $this Fluent Builder */ public function setTaggedText(string $taggedText): self { $this->options['taggedText'] = $taggedText; return $this; } /** * The communication channel the sample was captured. It can be: *voice*, *sms*, *chat*, *alexa*, *google-assistant*, or *slack*. If not included the value will be null * * @param string $sourceChannel The communication channel the sample was * captured. It can be: voice, sms, chat, alexa, * google-assistant, or slack. If not included the * value will be null * @return $this Fluent Builder */ public function setSourceChannel(string $sourceChannel): self { $this->options['sourceChannel'] = $sourceChannel; return $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.Understand.UpdateSampleOptions ' . $options . ']'; } } Preview/Understand/Assistant/Task/FieldContext.php 0000644 00000004657 15107452351 0016267 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\Task; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FieldContext extends InstanceContext { /** * Initialize the FieldContext * * @param Version $version Version that contains the resource * @param string $assistantSid The unique ID of the Assistant. * @param string $taskSid The unique ID of the Task associated with this Field. * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function __construct(Version $version, $assistantSid, $taskSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, 'taskSid' => $taskSid, 'sid' => $sid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Tasks/' . \rawurlencode($taskSid) . '/Fields/' . \rawurlencode($sid) . ''; } /** * Fetch the FieldInstance * * @return FieldInstance Fetched FieldInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FieldInstance { $payload = $this->version->fetch('GET', $this->uri); return new FieldInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'], $this->solution['sid'] ); } /** * Delete the FieldInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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.Understand.FieldContext ' . \implode(' ', $context) . ']'; } } Preview/Understand/Assistant/Task/TaskStatisticsInstance.php 0000644 00000007127 15107452351 0020334 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\Task; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $assistantSid * @property string $taskSid * @property int $samplesCount * @property int $fieldsCount * @property string $url */ class TaskStatisticsInstance extends InstanceResource { /** * Initialize the TaskStatisticsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The unique ID of the parent Assistant. * @param string $taskSid The unique ID of the Task associated with this Field. */ public function __construct(Version $version, array $payload, string $assistantSid, string $taskSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'taskSid' => Values::array_get($payload, 'task_sid'), 'samplesCount' => Values::array_get($payload, 'samples_count'), 'fieldsCount' => Values::array_get($payload, 'fields_count'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['assistantSid' => $assistantSid, 'taskSid' => $taskSid, ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return TaskStatisticsContext Context for this TaskStatisticsInstance */ protected function proxy(): TaskStatisticsContext { if (!$this->context) { $this->context = new TaskStatisticsContext( $this->version, $this->solution['assistantSid'], $this->solution['taskSid'] ); } return $this->context; } /** * Fetch the TaskStatisticsInstance * * @return TaskStatisticsInstance Fetched TaskStatisticsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TaskStatisticsInstance { 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.Understand.TaskStatisticsInstance ' . \implode(' ', $context) . ']'; } } Preview/Understand/Assistant/Task/TaskStatisticsList.php 0000644 00000002771 15107452351 0017503 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\Task; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class TaskStatisticsList extends ListResource { /** * Construct the TaskStatisticsList * * @param Version $version Version that contains the resource * @param string $assistantSid The unique ID of the parent Assistant. * @param string $taskSid The unique ID of the Task associated with this Field. */ public function __construct(Version $version, string $assistantSid, string $taskSid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, 'taskSid' => $taskSid, ]; } /** * Constructs a TaskStatisticsContext */ public function getContext(): TaskStatisticsContext { return new TaskStatisticsContext( $this->version, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Understand.TaskStatisticsList]'; } } Preview/Understand/Assistant/Task/TaskActionsOptions.php 0000644 00000003507 15107452351 0017467 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\Task; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class TaskActionsOptions { /** * @param array $actions The JSON actions that instruct the Assistant how to * perform this task. * @return UpdateTaskActionsOptions Options builder */ public static function update(array $actions = Values::ARRAY_NONE): UpdateTaskActionsOptions { return new UpdateTaskActionsOptions($actions); } } class UpdateTaskActionsOptions extends Options { /** * @param array $actions The JSON actions that instruct the Assistant how to * perform this task. */ public function __construct(array $actions = Values::ARRAY_NONE) { $this->options['actions'] = $actions; } /** * The JSON actions that instruct the Assistant how to perform this task. * * @param array $actions The JSON actions that instruct the Assistant how to * perform this task. * @return $this Fluent Builder */ public function setActions(array $actions): self { $this->options['actions'] = $actions; return $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.Understand.UpdateTaskActionsOptions ' . $options . ']'; } } Preview/Understand/Assistant/ModelBuildList.php 0000644 00000013256 15107452351 0015644 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ModelBuildList extends ListResource { /** * Construct the ModelBuildList * * @param Version $version Version that contains the resource * @param string $assistantSid The unique ID of the parent Assistant. */ public function __construct(Version $version, string $assistantSid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/ModelBuilds'; } /** * Streams ModelBuildInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * Reads ModelBuildInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ModelBuildInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of ModelBuildInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ModelBuildPage Page of ModelBuildInstance */ public function page($pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): ModelBuildPage { $params = Values::of(['PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ModelBuildPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ModelBuildInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ModelBuildPage Page of ModelBuildInstance */ public function getPage(string $targetUrl): ModelBuildPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ModelBuildPage($this->version, $response, $this->solution); } /** * Create the ModelBuildInstance * * @param array|Options $options Optional Arguments * @return ModelBuildInstance Created ModelBuildInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): ModelBuildInstance { $options = new Values($options); $data = Values::of([ 'StatusCallback' => $options['statusCallback'], 'UniqueName' => $options['uniqueName'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ModelBuildInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Constructs a ModelBuildContext * * @param string $sid The sid */ public function getContext(string $sid): ModelBuildContext { return new ModelBuildContext($this->version, $this->solution['assistantSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Understand.ModelBuildList]'; } } Preview/Understand/Assistant/AssistantInitiationActionsOptions.php 0000644 00000003375 15107452351 0021667 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class AssistantInitiationActionsOptions { /** * @param array $initiationActions The initiation_actions * @return UpdateAssistantInitiationActionsOptions Options builder */ public static function update(array $initiationActions = Values::ARRAY_NONE): UpdateAssistantInitiationActionsOptions { return new UpdateAssistantInitiationActionsOptions($initiationActions); } } class UpdateAssistantInitiationActionsOptions extends Options { /** * @param array $initiationActions The initiation_actions */ public function __construct(array $initiationActions = Values::ARRAY_NONE) { $this->options['initiationActions'] = $initiationActions; } /** * The initiation_actions * * @param array $initiationActions The initiation_actions * @return $this Fluent Builder */ public function setInitiationActions(array $initiationActions): self { $this->options['initiationActions'] = $initiationActions; return $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.Understand.UpdateAssistantInitiationActionsOptions ' . $options . ']'; } } Preview/Understand/Assistant/StyleSheetInstance.php 0000644 00000006747 15107452351 0016555 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $assistantSid * @property string $url * @property array $data */ class StyleSheetInstance extends InstanceResource { /** * Initialize the StyleSheetInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The unique ID of the Assistant */ public function __construct(Version $version, array $payload, string $assistantSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'url' => Values::array_get($payload, 'url'), 'data' => Values::array_get($payload, 'data'), ]; $this->solution = ['assistantSid' => $assistantSid, ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return StyleSheetContext Context for this StyleSheetInstance */ protected function proxy(): StyleSheetContext { if (!$this->context) { $this->context = new StyleSheetContext($this->version, $this->solution['assistantSid']); } return $this->context; } /** * Fetch the StyleSheetInstance * * @return StyleSheetInstance Fetched StyleSheetInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): StyleSheetInstance { return $this->proxy()->fetch(); } /** * Update the StyleSheetInstance * * @param array|Options $options Optional Arguments * @return StyleSheetInstance Updated StyleSheetInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): StyleSheetInstance { 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.Understand.StyleSheetInstance ' . \implode(' ', $context) . ']'; } } Preview/Understand/Assistant/FieldTypePage.php 0000644 00000002640 15107452351 0015445 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FieldTypePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return FieldTypeInstance \Twilio\Rest\Preview\Understand\Assistant\FieldTypeInstance */ public function buildInstance(array $payload): FieldTypeInstance { return new FieldTypeInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Understand.FieldTypePage]'; } } Preview/Understand/Assistant/DialoguePage.php 0000644 00000002632 15107452351 0015312 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DialoguePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return DialogueInstance \Twilio\Rest\Preview\Understand\Assistant\DialogueInstance */ public function buildInstance(array $payload): DialogueInstance { return new DialogueInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Understand.DialoguePage]'; } } Preview/Understand/Assistant/QueryList.php 0000644 00000015004 15107452351 0014722 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class QueryList extends ListResource { /** * Construct the QueryList * * @param Version $version Version that contains the resource * @param string $assistantSid The unique ID of the parent Assistant. */ public function __construct(Version $version, string $assistantSid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Queries'; } /** * Streams QueryInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * Reads QueryInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return QueryInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of QueryInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return QueryPage Page of QueryInstance */ public function page(array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): QueryPage { $options = new Values($options); $params = Values::of([ 'Language' => $options['language'], 'ModelBuild' => $options['modelBuild'], 'Status' => $options['status'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new QueryPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of QueryInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return QueryPage Page of QueryInstance */ public function getPage(string $targetUrl): QueryPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new QueryPage($this->version, $response, $this->solution); } /** * Create the QueryInstance * * @param string $language An ISO language-country string of the sample. * @param string $query A user-provided string that uniquely identifies this * resource as an alternative to the sid. It can be up to * 2048 characters long. * @param array|Options $options Optional Arguments * @return QueryInstance Created QueryInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $language, string $query, array $options = []): QueryInstance { $options = new Values($options); $data = Values::of([ 'Language' => $language, 'Query' => $query, 'Tasks' => $options['tasks'], 'ModelBuild' => $options['modelBuild'], 'Field' => $options['field'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new QueryInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Constructs a QueryContext * * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function getContext(string $sid): QueryContext { return new QueryContext($this->version, $this->solution['assistantSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Understand.QueryList]'; } } Preview/Understand/Assistant/QueryInstance.php 0000644 00000011607 15107452351 0015560 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property array $results * @property string $language * @property string $modelBuildSid * @property string $query * @property string $sampleSid * @property string $assistantSid * @property string $sid * @property string $status * @property string $url * @property string $sourceChannel */ class QueryInstance extends InstanceResource { /** * Initialize the QueryInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The unique ID of the parent Assistant. * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function __construct(Version $version, array $payload, string $assistantSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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')), 'results' => Values::array_get($payload, 'results'), 'language' => Values::array_get($payload, 'language'), 'modelBuildSid' => Values::array_get($payload, 'model_build_sid'), 'query' => Values::array_get($payload, 'query'), 'sampleSid' => Values::array_get($payload, 'sample_sid'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'sid' => Values::array_get($payload, 'sid'), 'status' => Values::array_get($payload, 'status'), 'url' => Values::array_get($payload, 'url'), 'sourceChannel' => Values::array_get($payload, 'source_channel'), ]; $this->solution = ['assistantSid' => $assistantSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return QueryContext Context for this QueryInstance */ protected function proxy(): QueryContext { if (!$this->context) { $this->context = new QueryContext( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the QueryInstance * * @return QueryInstance Fetched QueryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): QueryInstance { return $this->proxy()->fetch(); } /** * Update the QueryInstance * * @param array|Options $options Optional Arguments * @return QueryInstance Updated QueryInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): QueryInstance { return $this->proxy()->update($options); } /** * Delete the QueryInstance * * @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.Preview.Understand.QueryInstance ' . \implode(' ', $context) . ']'; } } Preview/Understand/Assistant/QueryPage.php 0000644 00000002610 15107452351 0014662 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class QueryPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return QueryInstance \Twilio\Rest\Preview\Understand\Assistant\QueryInstance */ public function buildInstance(array $payload): QueryInstance { return new QueryInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Understand.QueryPage]'; } } Preview/Understand/Assistant/TaskInstance.php 0000644 00000013005 15107452351 0015347 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Preview\Understand\Assistant\Task\FieldList; use Twilio\Rest\Preview\Understand\Assistant\Task\SampleList; use Twilio\Rest\Preview\Understand\Assistant\Task\TaskActionsList; use Twilio\Rest\Preview\Understand\Assistant\Task\TaskStatisticsList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property array $links * @property string $assistantSid * @property string $sid * @property string $uniqueName * @property string $actionsUrl * @property string $url */ class TaskInstance extends InstanceResource { protected $_fields; protected $_samples; protected $_taskActions; protected $_statistics; /** * Initialize the TaskInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The unique ID of the Assistant. * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function __construct(Version $version, array $payload, string $assistantSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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'), 'links' => Values::array_get($payload, 'links'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'actionsUrl' => Values::array_get($payload, 'actions_url'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['assistantSid' => $assistantSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return TaskContext Context for this TaskInstance */ protected function proxy(): TaskContext { if (!$this->context) { $this->context = new TaskContext( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->context; } /** * 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); } /** * Delete the TaskInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Access the fields */ protected function getFields(): FieldList { return $this->proxy()->fields; } /** * Access the samples */ protected function getSamples(): SampleList { return $this->proxy()->samples; } /** * Access the taskActions */ protected function getTaskActions(): TaskActionsList { return $this->proxy()->taskActions; } /** * Access the statistics */ protected function getStatistics(): TaskStatisticsList { 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.Preview.Understand.TaskInstance ' . \implode(' ', $context) . ']'; } } Preview/Understand/Assistant/AssistantInitiationActionsPage.php 0000644 00000003064 15107452351 0021103 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AssistantInitiationActionsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return AssistantInitiationActionsInstance \Twilio\Rest\Preview\Understand\Assistant\AssistantInitiationActionsInstance */ public function buildInstance(array $payload): AssistantInitiationActionsInstance { return new AssistantInitiationActionsInstance( $this->version, $payload, $this->solution['assistantSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Understand.AssistantInitiationActionsPage]'; } } Preview/Understand/Assistant/FieldTypeContext.php 0000644 00000011257 15107452351 0016221 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Preview\Understand\Assistant\FieldType\FieldValueList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property FieldValueList $fieldValues * @method \Twilio\Rest\Preview\Understand\Assistant\FieldType\FieldValueContext fieldValues(string $sid) */ class FieldTypeContext extends InstanceContext { protected $_fieldValues; /** * Initialize the FieldTypeContext * * @param Version $version Version that contains the resource * @param string $assistantSid The assistant_sid * @param string $sid The sid */ public function __construct(Version $version, $assistantSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, 'sid' => $sid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/FieldTypes/' . \rawurlencode($sid) . ''; } /** * Fetch the FieldTypeInstance * * @return FieldTypeInstance Fetched FieldTypeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FieldTypeInstance { $payload = $this->version->fetch('GET', $this->uri); return new FieldTypeInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Update the FieldTypeInstance * * @param array|Options $options Optional Arguments * @return FieldTypeInstance Updated FieldTypeInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): FieldTypeInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new FieldTypeInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Delete the FieldTypeInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Access the fieldValues */ protected function getFieldValues(): FieldValueList { if (!$this->_fieldValues) { $this->_fieldValues = new FieldValueList( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->_fieldValues; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return 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.Understand.FieldTypeContext ' . \implode(' ', $context) . ']'; } } Preview/Understand/Assistant/DialogueList.php 0000644 00000002504 15107452351 0015347 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DialogueList extends ListResource { /** * Construct the DialogueList * * @param Version $version Version that contains the resource * @param string $assistantSid The unique ID of the parent Assistant. */ public function __construct(Version $version, string $assistantSid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, ]; } /** * Constructs a DialogueContext * * @param string $sid The sid */ public function getContext(string $sid): DialogueContext { return new DialogueContext($this->version, $this->solution['assistantSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Understand.DialogueList]'; } } Preview/Understand/Assistant/AssistantFallbackActionsInstance.php 0000644 00000007551 15107452351 0021370 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $assistantSid * @property string $url * @property array $data */ class AssistantFallbackActionsInstance extends InstanceResource { /** * Initialize the AssistantFallbackActionsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The assistant_sid */ public function __construct(Version $version, array $payload, string $assistantSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'url' => Values::array_get($payload, 'url'), 'data' => Values::array_get($payload, 'data'), ]; $this->solution = ['assistantSid' => $assistantSid, ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AssistantFallbackActionsContext Context for this * AssistantFallbackActionsInstance */ protected function proxy(): AssistantFallbackActionsContext { if (!$this->context) { $this->context = new AssistantFallbackActionsContext( $this->version, $this->solution['assistantSid'] ); } return $this->context; } /** * Fetch the AssistantFallbackActionsInstance * * @return AssistantFallbackActionsInstance Fetched * AssistantFallbackActionsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AssistantFallbackActionsInstance { return $this->proxy()->fetch(); } /** * Update the AssistantFallbackActionsInstance * * @param array|Options $options Optional Arguments * @return AssistantFallbackActionsInstance Updated * AssistantFallbackActionsInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): AssistantFallbackActionsInstance { 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.Understand.AssistantFallbackActionsInstance ' . \implode(' ', $context) . ']'; } } Preview/Understand/Assistant/ModelBuildPage.php 0000644 00000002646 15107452351 0015606 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ModelBuildPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ModelBuildInstance \Twilio\Rest\Preview\Understand\Assistant\ModelBuildInstance */ public function buildInstance(array $payload): ModelBuildInstance { return new ModelBuildInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Understand.ModelBuildPage]'; } } Preview/Understand/Assistant/AssistantFallbackActionsContext.php 0000644 00000005423 15107452351 0021244 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AssistantFallbackActionsContext extends InstanceContext { /** * Initialize the AssistantFallbackActionsContext * * @param Version $version Version that contains the resource * @param string $assistantSid The assistant_sid */ public function __construct(Version $version, $assistantSid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/FallbackActions'; } /** * Fetch the AssistantFallbackActionsInstance * * @return AssistantFallbackActionsInstance Fetched * AssistantFallbackActionsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AssistantFallbackActionsInstance { $payload = $this->version->fetch('GET', $this->uri); return new AssistantFallbackActionsInstance( $this->version, $payload, $this->solution['assistantSid'] ); } /** * Update the AssistantFallbackActionsInstance * * @param array|Options $options Optional Arguments * @return AssistantFallbackActionsInstance Updated * AssistantFallbackActionsInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): AssistantFallbackActionsInstance { $options = new Values($options); $data = Values::of(['FallbackActions' => Serialize::jsonObject($options['fallbackActions']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new AssistantFallbackActionsInstance( $this->version, $payload, $this->solution['assistantSid'] ); } /** * Provide 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.Understand.AssistantFallbackActionsContext ' . \implode(' ', $context) . ']'; } } Preview/Understand/Assistant/TaskOptions.php 0000644 00000021007 15107452351 0015237 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class TaskOptions { /** * @param string $friendlyName A user-provided string that identifies this * resource. It is non-unique and can up to 255 * characters long. * @param array $actions A user-provided JSON object encoded as a string to * specify the actions for this task. It is optional and * non-unique. * @param string $actionsUrl User-provided HTTP endpoint where from the * assistant fetches actions * @return CreateTaskOptions Options builder */ public static function create(string $friendlyName = Values::NONE, array $actions = Values::ARRAY_NONE, string $actionsUrl = Values::NONE): CreateTaskOptions { return new CreateTaskOptions($friendlyName, $actions, $actionsUrl); } /** * @param string $friendlyName A user-provided string that identifies this * resource. It is non-unique and can up to 255 * characters long. * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. * @param array $actions A user-provided JSON object encoded as a string to * specify the actions for this task. It is optional and * non-unique. * @param string $actionsUrl User-provided HTTP endpoint where from the * assistant fetches actions * @return UpdateTaskOptions Options builder */ public static function update(string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, array $actions = Values::ARRAY_NONE, string $actionsUrl = Values::NONE): UpdateTaskOptions { return new UpdateTaskOptions($friendlyName, $uniqueName, $actions, $actionsUrl); } } class CreateTaskOptions extends Options { /** * @param string $friendlyName A user-provided string that identifies this * resource. It is non-unique and can up to 255 * characters long. * @param array $actions A user-provided JSON object encoded as a string to * specify the actions for this task. It is optional and * non-unique. * @param string $actionsUrl User-provided HTTP endpoint where from the * assistant fetches actions */ public function __construct(string $friendlyName = Values::NONE, array $actions = Values::ARRAY_NONE, string $actionsUrl = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['actions'] = $actions; $this->options['actionsUrl'] = $actionsUrl; } /** * A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. * * @param string $friendlyName A user-provided string that identifies this * resource. It is non-unique and can up to 255 * characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * A user-provided JSON object encoded as a string to specify the actions for this task. It is optional and non-unique. * * @param array $actions A user-provided JSON object encoded as a string to * specify the actions for this task. It is optional and * non-unique. * @return $this Fluent Builder */ public function setActions(array $actions): self { $this->options['actions'] = $actions; return $this; } /** * User-provided HTTP endpoint where from the assistant fetches actions * * @param string $actionsUrl User-provided HTTP endpoint where from the * assistant fetches actions * @return $this Fluent Builder */ public function setActionsUrl(string $actionsUrl): self { $this->options['actionsUrl'] = $actionsUrl; return $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.Understand.CreateTaskOptions ' . $options . ']'; } } class UpdateTaskOptions extends Options { /** * @param string $friendlyName A user-provided string that identifies this * resource. It is non-unique and can up to 255 * characters long. * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. * @param array $actions A user-provided JSON object encoded as a string to * specify the actions for this task. It is optional and * non-unique. * @param string $actionsUrl User-provided HTTP endpoint where from the * assistant fetches actions */ public function __construct(string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, array $actions = Values::ARRAY_NONE, string $actionsUrl = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['actions'] = $actions; $this->options['actionsUrl'] = $actionsUrl; } /** * A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. * * @param string $friendlyName A user-provided string that identifies this * resource. It is non-unique and can up to 255 * characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. * * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * A user-provided JSON object encoded as a string to specify the actions for this task. It is optional and non-unique. * * @param array $actions A user-provided JSON object encoded as a string to * specify the actions for this task. It is optional and * non-unique. * @return $this Fluent Builder */ public function setActions(array $actions): self { $this->options['actions'] = $actions; return $this; } /** * User-provided HTTP endpoint where from the assistant fetches actions * * @param string $actionsUrl User-provided HTTP endpoint where from the * assistant fetches actions * @return $this Fluent Builder */ public function setActionsUrl(string $actionsUrl): self { $this->options['actionsUrl'] = $actionsUrl; return $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.Understand.UpdateTaskOptions ' . $options . ']'; } } Preview/Understand/Assistant/FieldTypeList.php 0000644 00000013522 15107452351 0015505 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FieldTypeList extends ListResource { /** * Construct the FieldTypeList * * @param Version $version Version that contains the resource * @param string $assistantSid The unique ID of the Assistant. */ public function __construct(Version $version, string $assistantSid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/FieldTypes'; } /** * Streams FieldTypeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * Reads FieldTypeInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FieldTypeInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of FieldTypeInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return FieldTypePage Page of FieldTypeInstance */ public function page($pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): FieldTypePage { $params = Values::of(['PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new FieldTypePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FieldTypeInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return FieldTypePage Page of FieldTypeInstance */ public function getPage(string $targetUrl): FieldTypePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FieldTypePage($this->version, $response, $this->solution); } /** * Create the FieldTypeInstance * * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. * @param array|Options $options Optional Arguments * @return FieldTypeInstance Created FieldTypeInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $uniqueName, array $options = []): FieldTypeInstance { $options = new Values($options); $data = Values::of(['UniqueName' => $uniqueName, 'FriendlyName' => $options['friendlyName'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new FieldTypeInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Constructs a FieldTypeContext * * @param string $sid The sid */ public function getContext(string $sid): FieldTypeContext { return new FieldTypeContext($this->version, $this->solution['assistantSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Understand.FieldTypeList]'; } } Preview/Understand/Assistant/QueryOptions.php 0000644 00000022654 15107452351 0015453 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class QueryOptions { /** * @param string $language An ISO language-country string of the sample. * @param string $modelBuild The Model Build Sid or unique name of the Model * Build to be queried. * @param string $status A string that described the query status. The values * can be: pending_review, reviewed, discarded * @return ReadQueryOptions Options builder */ public static function read(string $language = Values::NONE, string $modelBuild = Values::NONE, string $status = Values::NONE): ReadQueryOptions { return new ReadQueryOptions($language, $modelBuild, $status); } /** * @param string $tasks Constraints the query to a set of tasks. Useful when * you need to constrain the paths the user can take. * Tasks should be comma separated task-unique-name-1, * task-unique-name-2 * @param string $modelBuild The Model Build Sid or unique name of the Model * Build to be queried. * @param string $field Constraints the query to a given Field with an task. * Useful when you know the Field you are expecting. It * accepts one field in the format * task-unique-name-1:field-unique-name * @return CreateQueryOptions Options builder */ public static function create(string $tasks = Values::NONE, string $modelBuild = Values::NONE, string $field = Values::NONE): CreateQueryOptions { return new CreateQueryOptions($tasks, $modelBuild, $field); } /** * @param string $sampleSid An optional reference to the Sample created from * this query. * @param string $status A string that described the query status. The values * can be: pending_review, reviewed, discarded * @return UpdateQueryOptions Options builder */ public static function update(string $sampleSid = Values::NONE, string $status = Values::NONE): UpdateQueryOptions { return new UpdateQueryOptions($sampleSid, $status); } } class ReadQueryOptions extends Options { /** * @param string $language An ISO language-country string of the sample. * @param string $modelBuild The Model Build Sid or unique name of the Model * Build to be queried. * @param string $status A string that described the query status. The values * can be: pending_review, reviewed, discarded */ public function __construct(string $language = Values::NONE, string $modelBuild = Values::NONE, string $status = Values::NONE) { $this->options['language'] = $language; $this->options['modelBuild'] = $modelBuild; $this->options['status'] = $status; } /** * An ISO language-country string of the sample. * * @param string $language An ISO language-country string of the sample. * @return $this Fluent Builder */ public function setLanguage(string $language): self { $this->options['language'] = $language; return $this; } /** * The Model Build Sid or unique name of the Model Build to be queried. * * @param string $modelBuild The Model Build Sid or unique name of the Model * Build to be queried. * @return $this Fluent Builder */ public function setModelBuild(string $modelBuild): self { $this->options['modelBuild'] = $modelBuild; return $this; } /** * A string that described the query status. The values can be: pending_review, reviewed, discarded * * @param string $status A string that described the query status. The values * can be: pending_review, reviewed, discarded * @return $this Fluent Builder */ public function setStatus(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.Understand.ReadQueryOptions ' . $options . ']'; } } class CreateQueryOptions extends Options { /** * @param string $tasks Constraints the query to a set of tasks. Useful when * you need to constrain the paths the user can take. * Tasks should be comma separated task-unique-name-1, * task-unique-name-2 * @param string $modelBuild The Model Build Sid or unique name of the Model * Build to be queried. * @param string $field Constraints the query to a given Field with an task. * Useful when you know the Field you are expecting. It * accepts one field in the format * task-unique-name-1:field-unique-name */ public function __construct(string $tasks = Values::NONE, string $modelBuild = Values::NONE, string $field = Values::NONE) { $this->options['tasks'] = $tasks; $this->options['modelBuild'] = $modelBuild; $this->options['field'] = $field; } /** * Constraints the query to a set of tasks. Useful when you need to constrain the paths the user can take. Tasks should be comma separated *task-unique-name-1*, *task-unique-name-2* * * @param string $tasks Constraints the query to a set of tasks. Useful when * you need to constrain the paths the user can take. * Tasks should be comma separated task-unique-name-1, * task-unique-name-2 * @return $this Fluent Builder */ public function setTasks(string $tasks): self { $this->options['tasks'] = $tasks; return $this; } /** * The Model Build Sid or unique name of the Model Build to be queried. * * @param string $modelBuild The Model Build Sid or unique name of the Model * Build to be queried. * @return $this Fluent Builder */ public function setModelBuild(string $modelBuild): self { $this->options['modelBuild'] = $modelBuild; return $this; } /** * Constraints the query to a given Field with an task. Useful when you know the Field you are expecting. It accepts one field in the format *task-unique-name-1*:*field-unique-name* * * @param string $field Constraints the query to a given Field with an task. * Useful when you know the Field you are expecting. It * accepts one field in the format * task-unique-name-1:field-unique-name * @return $this Fluent Builder */ public function setField(string $field): self { $this->options['field'] = $field; return $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.Understand.CreateQueryOptions ' . $options . ']'; } } class UpdateQueryOptions extends Options { /** * @param string $sampleSid An optional reference to the Sample created from * this query. * @param string $status A string that described the query status. The values * can be: pending_review, reviewed, discarded */ public function __construct(string $sampleSid = Values::NONE, string $status = Values::NONE) { $this->options['sampleSid'] = $sampleSid; $this->options['status'] = $status; } /** * An optional reference to the Sample created from this query. * * @param string $sampleSid An optional reference to the Sample created from * this query. * @return $this Fluent Builder */ public function setSampleSid(string $sampleSid): self { $this->options['sampleSid'] = $sampleSid; return $this; } /** * A string that described the query status. The values can be: pending_review, reviewed, discarded * * @param string $status A string that described the query status. The values * can be: pending_review, reviewed, discarded * @return $this Fluent Builder */ public function setStatus(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.Understand.UpdateQueryOptions ' . $options . ']'; } } Preview/Understand/Assistant/AssistantFallbackActionsList.php 0000644 00000002525 15107452351 0020533 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AssistantFallbackActionsList extends ListResource { /** * Construct the AssistantFallbackActionsList * * @param Version $version Version that contains the resource * @param string $assistantSid The assistant_sid */ public function __construct(Version $version, string $assistantSid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, ]; } /** * Constructs a AssistantFallbackActionsContext */ public function getContext(): AssistantFallbackActionsContext { return new AssistantFallbackActionsContext($this->version, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Understand.AssistantFallbackActionsList]'; } } Preview/Understand/Assistant/FieldType/FieldValueOptions.php 0000644 00000006437 15107452351 0020254 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\FieldType; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class FieldValueOptions { /** * @param string $language An ISO language-country string of the value. For * example: en-US * @return ReadFieldValueOptions Options builder */ public static function read(string $language = Values::NONE): ReadFieldValueOptions { return new ReadFieldValueOptions($language); } /** * @param string $synonymOf A value that indicates this field value is a * synonym of. Empty if the value is not a synonym. * @return CreateFieldValueOptions Options builder */ public static function create(string $synonymOf = Values::NONE): CreateFieldValueOptions { return new CreateFieldValueOptions($synonymOf); } } class ReadFieldValueOptions extends Options { /** * @param string $language An ISO language-country string of the value. For * example: en-US */ public function __construct(string $language = Values::NONE) { $this->options['language'] = $language; } /** * An ISO language-country string of the value. For example: *en-US* * * @param string $language An ISO language-country string of the value. For * example: en-US * @return $this Fluent Builder */ public function setLanguage(string $language): self { $this->options['language'] = $language; return $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.Understand.ReadFieldValueOptions ' . $options . ']'; } } class CreateFieldValueOptions extends Options { /** * @param string $synonymOf A value that indicates this field value is a * synonym of. Empty if the value is not a synonym. */ public function __construct(string $synonymOf = Values::NONE) { $this->options['synonymOf'] = $synonymOf; } /** * A value that indicates this field value is a synonym of. Empty if the value is not a synonym. * * @param string $synonymOf A value that indicates this field value is a * synonym of. Empty if the value is not a synonym. * @return $this Fluent Builder */ public function setSynonymOf(string $synonymOf): self { $this->options['synonymOf'] = $synonymOf; return $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.Understand.CreateFieldValueOptions ' . $options . ']'; } } Preview/Understand/Assistant/FieldType/FieldValueInstance.php 0000644 00000010776 15107452351 0020366 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\FieldType; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $fieldTypeSid * @property string $language * @property string $assistantSid * @property string $sid * @property string $value * @property string $url * @property string $synonymOf */ class FieldValueInstance extends InstanceResource { /** * Initialize the FieldValueInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The unique ID of the Assistant. * @param string $fieldTypeSid The unique ID of the Field Type associated with * this Field Value. * @param string $sid The sid */ public function __construct(Version $version, array $payload, string $assistantSid, string $fieldTypeSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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')), 'fieldTypeSid' => Values::array_get($payload, 'field_type_sid'), 'language' => Values::array_get($payload, 'language'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'sid' => Values::array_get($payload, 'sid'), 'value' => Values::array_get($payload, 'value'), 'url' => Values::array_get($payload, 'url'), 'synonymOf' => Values::array_get($payload, 'synonym_of'), ]; $this->solution = [ 'assistantSid' => $assistantSid, 'fieldTypeSid' => $fieldTypeSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return FieldValueContext Context for this FieldValueInstance */ protected function proxy(): FieldValueContext { if (!$this->context) { $this->context = new FieldValueContext( $this->version, $this->solution['assistantSid'], $this->solution['fieldTypeSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the FieldValueInstance * * @return FieldValueInstance Fetched FieldValueInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FieldValueInstance { return $this->proxy()->fetch(); } /** * Delete the FieldValueInstance * * @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.Preview.Understand.FieldValueInstance ' . \implode(' ', $context) . ']'; } } Preview/Understand/Assistant/FieldType/FieldValueContext.php 0000644 00000004610 15107452351 0020234 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\FieldType; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FieldValueContext extends InstanceContext { /** * Initialize the FieldValueContext * * @param Version $version Version that contains the resource * @param string $assistantSid The assistant_sid * @param string $fieldTypeSid The field_type_sid * @param string $sid The sid */ public function __construct(Version $version, $assistantSid, $fieldTypeSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, 'fieldTypeSid' => $fieldTypeSid, 'sid' => $sid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/FieldTypes/' . \rawurlencode($fieldTypeSid) . '/FieldValues/' . \rawurlencode($sid) . ''; } /** * Fetch the FieldValueInstance * * @return FieldValueInstance Fetched FieldValueInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FieldValueInstance { $payload = $this->version->fetch('GET', $this->uri); return new FieldValueInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['fieldTypeSid'], $this->solution['sid'] ); } /** * Delete the FieldValueInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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.Understand.FieldValueContext ' . \implode(' ', $context) . ']'; } } Preview/Understand/Assistant/FieldType/FieldValuePage.php 0000644 00000003025 15107452351 0017463 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\FieldType; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FieldValuePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return FieldValueInstance \Twilio\Rest\Preview\Understand\Assistant\FieldType\FieldValueInstance */ public function buildInstance(array $payload): FieldValueInstance { return new FieldValueInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['fieldTypeSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Understand.FieldValuePage]'; } } Preview/Understand/Assistant/FieldType/FieldValueList.php 0000644 00000015434 15107452351 0017531 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\FieldType; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FieldValueList extends ListResource { /** * Construct the FieldValueList * * @param Version $version Version that contains the resource * @param string $assistantSid The unique ID of the Assistant. * @param string $fieldTypeSid The unique ID of the Field Type associated with * this Field Value. */ public function __construct(Version $version, string $assistantSid, string $fieldTypeSid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, 'fieldTypeSid' => $fieldTypeSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/FieldTypes/' . \rawurlencode($fieldTypeSid) . '/FieldValues'; } /** * Streams FieldValueInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * Reads FieldValueInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FieldValueInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of FieldValueInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return FieldValuePage Page of FieldValueInstance */ public function page(array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): FieldValuePage { $options = new Values($options); $params = Values::of([ 'Language' => $options['language'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new FieldValuePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FieldValueInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return FieldValuePage Page of FieldValueInstance */ public function getPage(string $targetUrl): FieldValuePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FieldValuePage($this->version, $response, $this->solution); } /** * Create the FieldValueInstance * * @param string $language An ISO language-country string of the value. * @param string $value A user-provided string that uniquely identifies this * resource as an alternative to the sid. Unique up to 64 * characters long. * @param array|Options $options Optional Arguments * @return FieldValueInstance Created FieldValueInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $language, string $value, array $options = []): FieldValueInstance { $options = new Values($options); $data = Values::of([ 'Language' => $language, 'Value' => $value, 'SynonymOf' => $options['synonymOf'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new FieldValueInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['fieldTypeSid'] ); } /** * Constructs a FieldValueContext * * @param string $sid The sid */ public function getContext(string $sid): FieldValueContext { return new FieldValueContext( $this->version, $this->solution['assistantSid'], $this->solution['fieldTypeSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Understand.FieldValueList]'; } } Preview/Understand/Assistant/DialogueInstance.php 0000644 00000006545 15107452351 0016211 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $assistantSid * @property string $sid * @property array $data * @property string $url */ class DialogueInstance extends InstanceResource { /** * Initialize the DialogueInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The unique ID of the parent Assistant. * @param string $sid The sid */ public function __construct(Version $version, array $payload, string $assistantSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'sid' => Values::array_get($payload, 'sid'), 'data' => Values::array_get($payload, 'data'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['assistantSid' => $assistantSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return DialogueContext Context for this DialogueInstance */ protected function proxy(): DialogueContext { if (!$this->context) { $this->context = new DialogueContext( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the DialogueInstance * * @return DialogueInstance Fetched DialogueInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DialogueInstance { 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.Understand.DialogueInstance ' . \implode(' ', $context) . ']'; } } Preview/Understand/Assistant/AssistantInitiationActionsInstance.php 0000644 00000007615 15107452351 0022001 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $assistantSid * @property string $url * @property array $data */ class AssistantInitiationActionsInstance extends InstanceResource { /** * Initialize the AssistantInitiationActionsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The assistant_sid */ public function __construct(Version $version, array $payload, string $assistantSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'url' => Values::array_get($payload, 'url'), 'data' => Values::array_get($payload, 'data'), ]; $this->solution = ['assistantSid' => $assistantSid, ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AssistantInitiationActionsContext Context for this * AssistantInitiationActionsInstance */ protected function proxy(): AssistantInitiationActionsContext { if (!$this->context) { $this->context = new AssistantInitiationActionsContext( $this->version, $this->solution['assistantSid'] ); } return $this->context; } /** * Fetch the AssistantInitiationActionsInstance * * @return AssistantInitiationActionsInstance Fetched * AssistantInitiationActionsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AssistantInitiationActionsInstance { return $this->proxy()->fetch(); } /** * Update the AssistantInitiationActionsInstance * * @param array|Options $options Optional Arguments * @return AssistantInitiationActionsInstance Updated * AssistantInitiationActionsInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): AssistantInitiationActionsInstance { 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.Understand.AssistantInitiationActionsInstance ' . \implode(' ', $context) . ']'; } } Preview/Understand/Assistant/AssistantInitiationActionsContext.php 0000644 00000005467 15107452351 0021664 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AssistantInitiationActionsContext extends InstanceContext { /** * Initialize the AssistantInitiationActionsContext * * @param Version $version Version that contains the resource * @param string $assistantSid The assistant_sid */ public function __construct(Version $version, $assistantSid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/InitiationActions'; } /** * Fetch the AssistantInitiationActionsInstance * * @return AssistantInitiationActionsInstance Fetched * AssistantInitiationActionsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AssistantInitiationActionsInstance { $payload = $this->version->fetch('GET', $this->uri); return new AssistantInitiationActionsInstance( $this->version, $payload, $this->solution['assistantSid'] ); } /** * Update the AssistantInitiationActionsInstance * * @param array|Options $options Optional Arguments * @return AssistantInitiationActionsInstance Updated * AssistantInitiationActionsInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): AssistantInitiationActionsInstance { $options = new Values($options); $data = Values::of(['InitiationActions' => Serialize::jsonObject($options['initiationActions']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new AssistantInitiationActionsInstance( $this->version, $payload, $this->solution['assistantSid'] ); } /** * Provide 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.Understand.AssistantInitiationActionsContext ' . \implode(' ', $context) . ']'; } } Preview/Understand/Assistant/TaskList.php 0000644 00000013725 15107452351 0014527 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class TaskList extends ListResource { /** * Construct the TaskList * * @param Version $version Version that contains the resource * @param string $assistantSid The unique ID of the Assistant. */ public function __construct(Version $version, string $assistantSid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Tasks'; } /** * Streams TaskInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * Reads TaskInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TaskInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of TaskInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return TaskPage Page of TaskInstance */ public function page($pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): TaskPage { $params = Values::of(['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); } /** * Create the TaskInstance * * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. * @param array|Options $options Optional Arguments * @return TaskInstance Created TaskInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $uniqueName, array $options = []): TaskInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $uniqueName, 'FriendlyName' => $options['friendlyName'], 'Actions' => Serialize::jsonObject($options['actions']), 'ActionsUrl' => $options['actionsUrl'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new TaskInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Constructs a TaskContext * * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function getContext(string $sid): TaskContext { return new TaskContext($this->version, $this->solution['assistantSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Understand.TaskList]'; } } Preview/Understand/Assistant/StyleSheetOptions.php 0000644 00000003135 15107452351 0016430 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class StyleSheetOptions { /** * @param array $styleSheet The JSON Style sheet string * @return UpdateStyleSheetOptions Options builder */ public static function update(array $styleSheet = Values::ARRAY_NONE): UpdateStyleSheetOptions { return new UpdateStyleSheetOptions($styleSheet); } } class UpdateStyleSheetOptions extends Options { /** * @param array $styleSheet The JSON Style sheet string */ public function __construct(array $styleSheet = Values::ARRAY_NONE) { $this->options['styleSheet'] = $styleSheet; } /** * The JSON Style sheet string * * @param array $styleSheet The JSON Style sheet string * @return $this Fluent Builder */ public function setStyleSheet(array $styleSheet): self { $this->options['styleSheet'] = $styleSheet; return $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.Understand.UpdateStyleSheetOptions ' . $options . ']'; } } Preview/Understand/Assistant/StyleSheetPage.php 0000644 00000002646 15107452351 0015657 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class StyleSheetPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return StyleSheetInstance \Twilio\Rest\Preview\Understand\Assistant\StyleSheetInstance */ public function buildInstance(array $payload): StyleSheetInstance { return new StyleSheetInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Understand.StyleSheetPage]'; } } Preview/Understand/Assistant/ModelBuildContext.php 0000644 00000005571 15107452351 0016356 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ModelBuildContext extends InstanceContext { /** * Initialize the ModelBuildContext * * @param Version $version Version that contains the resource * @param string $assistantSid The assistant_sid * @param string $sid The sid */ public function __construct(Version $version, $assistantSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['assistantSid' => $assistantSid, 'sid' => $sid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/ModelBuilds/' . \rawurlencode($sid) . ''; } /** * Fetch the ModelBuildInstance * * @return ModelBuildInstance Fetched ModelBuildInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ModelBuildInstance { $payload = $this->version->fetch('GET', $this->uri); return new ModelBuildInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Update the ModelBuildInstance * * @param array|Options $options Optional Arguments * @return ModelBuildInstance Updated ModelBuildInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ModelBuildInstance { $options = new Values($options); $data = Values::of(['UniqueName' => $options['uniqueName'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ModelBuildInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Delete the ModelBuildInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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.Understand.ModelBuildContext ' . \implode(' ', $context) . ']'; } } Preview/Understand/Assistant/FieldTypeOptions.php 0000644 00000011634 15107452351 0016227 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class FieldTypeOptions { /** * @param string $friendlyName A user-provided string that identifies this * resource. It is non-unique and can up to 255 * characters long. * @return CreateFieldTypeOptions Options builder */ public static function create(string $friendlyName = Values::NONE): CreateFieldTypeOptions { return new CreateFieldTypeOptions($friendlyName); } /** * @param string $friendlyName A user-provided string that identifies this * resource. It is non-unique and can up to 255 * characters long. * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. * @return UpdateFieldTypeOptions Options builder */ public static function update(string $friendlyName = Values::NONE, string $uniqueName = Values::NONE): UpdateFieldTypeOptions { return new UpdateFieldTypeOptions($friendlyName, $uniqueName); } } class CreateFieldTypeOptions extends Options { /** * @param string $friendlyName A user-provided string that identifies this * resource. It is non-unique and can up to 255 * characters long. */ public function __construct(string $friendlyName = Values::NONE) { $this->options['friendlyName'] = $friendlyName; } /** * A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. * * @param string $friendlyName A user-provided string that identifies this * resource. It is non-unique and can up to 255 * characters long. * @return $this Fluent Builder */ public function setFriendlyName(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.Understand.CreateFieldTypeOptions ' . $options . ']'; } } class UpdateFieldTypeOptions extends Options { /** * @param string $friendlyName A user-provided string that identifies this * resource. It is non-unique and can up to 255 * characters long. * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. */ public function __construct(string $friendlyName = Values::NONE, string $uniqueName = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; } /** * A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. * * @param string $friendlyName A user-provided string that identifies this * resource. It is non-unique and can up to 255 * characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. * * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. * @return $this Fluent Builder */ public function setUniqueName(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.Understand.UpdateFieldTypeOptions ' . $options . ']'; } } Preview/Understand/Assistant/TaskPage.php 0000644 00000002602 15107452351 0014460 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class TaskPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return TaskInstance \Twilio\Rest\Preview\Understand\Assistant\TaskInstance */ public function buildInstance(array $payload): TaskInstance { return new TaskInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Understand.TaskPage]'; } } Preview/Understand/AssistantList.php 0000644 00000013665 15107452351 0013630 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AssistantList extends ListResource { /** * Construct the AssistantList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Assistants'; } /** * Streams AssistantInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * Reads AssistantInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AssistantInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of AssistantInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AssistantPage Page of AssistantInstance */ public function page($pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): AssistantPage { $params = Values::of(['PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AssistantPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AssistantInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AssistantPage Page of AssistantInstance */ public function getPage(string $targetUrl): AssistantPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AssistantPage($this->version, $response, $this->solution); } /** * Create the AssistantInstance * * @param array|Options $options Optional Arguments * @return AssistantInstance Created AssistantInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): AssistantInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'LogQueries' => Serialize::booleanToString($options['logQueries']), 'UniqueName' => $options['uniqueName'], 'CallbackUrl' => $options['callbackUrl'], 'CallbackEvents' => $options['callbackEvents'], 'FallbackActions' => Serialize::jsonObject($options['fallbackActions']), 'InitiationActions' => Serialize::jsonObject($options['initiationActions']), 'StyleSheet' => Serialize::jsonObject($options['styleSheet']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AssistantInstance($this->version, $payload); } /** * Constructs a AssistantContext * * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function getContext(string $sid): AssistantContext { return new AssistantContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Understand.AssistantList]'; } } Preview/Understand/AssistantContext.php 0000644 00000021030 15107452352 0014323 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Preview\Understand\Assistant\AssistantFallbackActionsList; use Twilio\Rest\Preview\Understand\Assistant\AssistantInitiationActionsList; use Twilio\Rest\Preview\Understand\Assistant\DialogueList; use Twilio\Rest\Preview\Understand\Assistant\FieldTypeList; use Twilio\Rest\Preview\Understand\Assistant\ModelBuildList; use Twilio\Rest\Preview\Understand\Assistant\QueryList; use Twilio\Rest\Preview\Understand\Assistant\StyleSheetList; use Twilio\Rest\Preview\Understand\Assistant\TaskList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property FieldTypeList $fieldTypes * @property TaskList $tasks * @property ModelBuildList $modelBuilds * @property QueryList $queries * @property AssistantFallbackActionsList $assistantFallbackActions * @property AssistantInitiationActionsList $assistantInitiationActions * @property DialogueList $dialogues * @property StyleSheetList $styleSheet * @method \Twilio\Rest\Preview\Understand\Assistant\FieldTypeContext fieldTypes(string $sid) * @method \Twilio\Rest\Preview\Understand\Assistant\TaskContext tasks(string $sid) * @method \Twilio\Rest\Preview\Understand\Assistant\ModelBuildContext modelBuilds(string $sid) * @method \Twilio\Rest\Preview\Understand\Assistant\QueryContext queries(string $sid) * @method \Twilio\Rest\Preview\Understand\Assistant\AssistantFallbackActionsContext assistantFallbackActions() * @method \Twilio\Rest\Preview\Understand\Assistant\AssistantInitiationActionsContext assistantInitiationActions() * @method \Twilio\Rest\Preview\Understand\Assistant\DialogueContext dialogues(string $sid) * @method \Twilio\Rest\Preview\Understand\Assistant\StyleSheetContext styleSheet() */ class AssistantContext extends InstanceContext { protected $_fieldTypes; protected $_tasks; protected $_modelBuilds; protected $_queries; protected $_assistantFallbackActions; protected $_assistantInitiationActions; protected $_dialogues; protected $_styleSheet; /** * Initialize the AssistantContext * * @param Version $version Version that contains the resource * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Assistants/' . \rawurlencode($sid) . ''; } /** * Fetch the AssistantInstance * * @return AssistantInstance Fetched AssistantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AssistantInstance { $payload = $this->version->fetch('GET', $this->uri); return new AssistantInstance($this->version, $payload, $this->solution['sid']); } /** * Update the AssistantInstance * * @param array|Options $options Optional Arguments * @return AssistantInstance Updated AssistantInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): AssistantInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'LogQueries' => Serialize::booleanToString($options['logQueries']), 'UniqueName' => $options['uniqueName'], 'CallbackUrl' => $options['callbackUrl'], 'CallbackEvents' => $options['callbackEvents'], 'FallbackActions' => Serialize::jsonObject($options['fallbackActions']), 'InitiationActions' => Serialize::jsonObject($options['initiationActions']), 'StyleSheet' => Serialize::jsonObject($options['styleSheet']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new AssistantInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the AssistantInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Access the fieldTypes */ protected function getFieldTypes(): FieldTypeList { if (!$this->_fieldTypes) { $this->_fieldTypes = new FieldTypeList($this->version, $this->solution['sid']); } return $this->_fieldTypes; } /** * Access the tasks */ protected function getTasks(): TaskList { if (!$this->_tasks) { $this->_tasks = new TaskList($this->version, $this->solution['sid']); } return $this->_tasks; } /** * Access the modelBuilds */ protected function getModelBuilds(): ModelBuildList { if (!$this->_modelBuilds) { $this->_modelBuilds = new ModelBuildList($this->version, $this->solution['sid']); } return $this->_modelBuilds; } /** * Access the queries */ protected function getQueries(): QueryList { if (!$this->_queries) { $this->_queries = new QueryList($this->version, $this->solution['sid']); } return $this->_queries; } /** * Access the assistantFallbackActions */ protected function getAssistantFallbackActions(): AssistantFallbackActionsList { if (!$this->_assistantFallbackActions) { $this->_assistantFallbackActions = new AssistantFallbackActionsList( $this->version, $this->solution['sid'] ); } return $this->_assistantFallbackActions; } /** * Access the assistantInitiationActions */ protected function getAssistantInitiationActions(): AssistantInitiationActionsList { if (!$this->_assistantInitiationActions) { $this->_assistantInitiationActions = new AssistantInitiationActionsList( $this->version, $this->solution['sid'] ); } return $this->_assistantInitiationActions; } /** * Access the dialogues */ protected function getDialogues(): DialogueList { if (!$this->_dialogues) { $this->_dialogues = new DialogueList($this->version, $this->solution['sid']); } return $this->_dialogues; } /** * Access the styleSheet */ protected function getStyleSheet(): StyleSheetList { if (!$this->_styleSheet) { $this->_styleSheet = new StyleSheetList($this->version, $this->solution['sid']); } return $this->_styleSheet; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return 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.Understand.AssistantContext ' . \implode(' ', $context) . ']'; } } Preview/Understand/AssistantInstance.php 0000644 00000015256 15107452352 0014460 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Preview\Understand\Assistant\AssistantFallbackActionsList; use Twilio\Rest\Preview\Understand\Assistant\AssistantInitiationActionsList; use Twilio\Rest\Preview\Understand\Assistant\DialogueList; use Twilio\Rest\Preview\Understand\Assistant\FieldTypeList; use Twilio\Rest\Preview\Understand\Assistant\ModelBuildList; use Twilio\Rest\Preview\Understand\Assistant\QueryList; use Twilio\Rest\Preview\Understand\Assistant\StyleSheetList; use Twilio\Rest\Preview\Understand\Assistant\TaskList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $latestModelBuildSid * @property array $links * @property bool $logQueries * @property string $sid * @property string $uniqueName * @property string $url * @property string $callbackUrl * @property string $callbackEvents */ class AssistantInstance extends InstanceResource { protected $_fieldTypes; protected $_tasks; protected $_modelBuilds; protected $_queries; protected $_assistantFallbackActions; protected $_assistantInitiationActions; protected $_dialogues; protected $_styleSheet; /** * Initialize the AssistantInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid A 34 character string that uniquely identifies this * resource. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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'), 'latestModelBuildSid' => Values::array_get($payload, 'latest_model_build_sid'), 'links' => Values::array_get($payload, 'links'), 'logQueries' => Values::array_get($payload, 'log_queries'), 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'url' => Values::array_get($payload, 'url'), 'callbackUrl' => Values::array_get($payload, 'callback_url'), 'callbackEvents' => Values::array_get($payload, 'callback_events'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AssistantContext Context for this AssistantInstance */ protected function proxy(): AssistantContext { if (!$this->context) { $this->context = new AssistantContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch the AssistantInstance * * @return AssistantInstance Fetched AssistantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AssistantInstance { return $this->proxy()->fetch(); } /** * Update the AssistantInstance * * @param array|Options $options Optional Arguments * @return AssistantInstance Updated AssistantInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): AssistantInstance { return $this->proxy()->update($options); } /** * Delete the AssistantInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Access the fieldTypes */ protected function getFieldTypes(): FieldTypeList { return $this->proxy()->fieldTypes; } /** * Access the tasks */ protected function getTasks(): TaskList { return $this->proxy()->tasks; } /** * Access the modelBuilds */ protected function getModelBuilds(): ModelBuildList { return $this->proxy()->modelBuilds; } /** * Access the queries */ protected function getQueries(): QueryList { return $this->proxy()->queries; } /** * Access the assistantFallbackActions */ protected function getAssistantFallbackActions(): AssistantFallbackActionsList { return $this->proxy()->assistantFallbackActions; } /** * Access the assistantInitiationActions */ protected function getAssistantInitiationActions(): AssistantInitiationActionsList { return $this->proxy()->assistantInitiationActions; } /** * Access the dialogues */ protected function getDialogues(): DialogueList { return $this->proxy()->dialogues; } /** * Access the styleSheet */ protected function getStyleSheet(): StyleSheetList { return $this->proxy()->styleSheet; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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.Understand.AssistantInstance ' . \implode(' ', $context) . ']'; } } Preview/Understand/AssistantOptions.php 0000644 00000044073 15107452352 0014346 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class AssistantOptions { /** * @param string $friendlyName A text description for the Assistant. It is * non-unique and can up to 255 characters long. * @param bool $logQueries A boolean that specifies whether queries should be * logged for 30 days further training. If false, no * queries will be stored, if true, queries will be * stored for 30 days and deleted thereafter. Defaults * to true if no value is provided. * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. * @param string $callbackUrl A user-provided URL to send event callbacks to. * @param string $callbackEvents Space-separated list of callback events that * will trigger callbacks. * @param array $fallbackActions The JSON actions to be executed when the * user's input is not recognized as matching any * Task. * @param array $initiationActions The JSON actions to be executed on inbound * phone calls when the Assistant has to say * something first. * @param array $styleSheet The JSON object that holds the style sheet for the * assistant * @return CreateAssistantOptions Options builder */ public static function create(string $friendlyName = Values::NONE, bool $logQueries = Values::NONE, string $uniqueName = Values::NONE, string $callbackUrl = Values::NONE, string $callbackEvents = Values::NONE, array $fallbackActions = Values::ARRAY_NONE, array $initiationActions = Values::ARRAY_NONE, array $styleSheet = Values::ARRAY_NONE): CreateAssistantOptions { return new CreateAssistantOptions($friendlyName, $logQueries, $uniqueName, $callbackUrl, $callbackEvents, $fallbackActions, $initiationActions, $styleSheet); } /** * @param string $friendlyName A text description for the Assistant. It is * non-unique and can up to 255 characters long. * @param bool $logQueries A boolean that specifies whether queries should be * logged for 30 days further training. If false, no * queries will be stored, if true, queries will be * stored for 30 days and deleted thereafter. Defaults * to true if no value is provided. * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. * @param string $callbackUrl A user-provided URL to send event callbacks to. * @param string $callbackEvents Space-separated list of callback events that * will trigger callbacks. * @param array $fallbackActions The JSON actions to be executed when the * user's input is not recognized as matching any * Task. * @param array $initiationActions The JSON actions to be executed on inbound * phone calls when the Assistant has to say * something first. * @param array $styleSheet The JSON object that holds the style sheet for the * assistant * @return UpdateAssistantOptions Options builder */ public static function update(string $friendlyName = Values::NONE, bool $logQueries = Values::NONE, string $uniqueName = Values::NONE, string $callbackUrl = Values::NONE, string $callbackEvents = Values::NONE, array $fallbackActions = Values::ARRAY_NONE, array $initiationActions = Values::ARRAY_NONE, array $styleSheet = Values::ARRAY_NONE): UpdateAssistantOptions { return new UpdateAssistantOptions($friendlyName, $logQueries, $uniqueName, $callbackUrl, $callbackEvents, $fallbackActions, $initiationActions, $styleSheet); } } class CreateAssistantOptions extends Options { /** * @param string $friendlyName A text description for the Assistant. It is * non-unique and can up to 255 characters long. * @param bool $logQueries A boolean that specifies whether queries should be * logged for 30 days further training. If false, no * queries will be stored, if true, queries will be * stored for 30 days and deleted thereafter. Defaults * to true if no value is provided. * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. * @param string $callbackUrl A user-provided URL to send event callbacks to. * @param string $callbackEvents Space-separated list of callback events that * will trigger callbacks. * @param array $fallbackActions The JSON actions to be executed when the * user's input is not recognized as matching any * Task. * @param array $initiationActions The JSON actions to be executed on inbound * phone calls when the Assistant has to say * something first. * @param array $styleSheet The JSON object that holds the style sheet for the * assistant */ public function __construct(string $friendlyName = Values::NONE, bool $logQueries = Values::NONE, string $uniqueName = Values::NONE, string $callbackUrl = Values::NONE, string $callbackEvents = Values::NONE, array $fallbackActions = Values::ARRAY_NONE, array $initiationActions = Values::ARRAY_NONE, array $styleSheet = Values::ARRAY_NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['logQueries'] = $logQueries; $this->options['uniqueName'] = $uniqueName; $this->options['callbackUrl'] = $callbackUrl; $this->options['callbackEvents'] = $callbackEvents; $this->options['fallbackActions'] = $fallbackActions; $this->options['initiationActions'] = $initiationActions; $this->options['styleSheet'] = $styleSheet; } /** * A text description for the Assistant. It is non-unique and can up to 255 characters long. * * @param string $friendlyName A text description for the Assistant. It is * non-unique and can up to 255 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided. * * @param bool $logQueries A boolean that specifies whether queries should be * logged for 30 days further training. If false, no * queries will be stored, if true, queries will be * stored for 30 days and deleted thereafter. Defaults * to true if no value is provided. * @return $this Fluent Builder */ public function setLogQueries(bool $logQueries): self { $this->options['logQueries'] = $logQueries; return $this; } /** * A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. * * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * A user-provided URL to send event callbacks to. * * @param string $callbackUrl A user-provided URL to send event callbacks to. * @return $this Fluent Builder */ public function setCallbackUrl(string $callbackUrl): self { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * Space-separated list of callback events that will trigger callbacks. * * @param string $callbackEvents Space-separated list of callback events that * will trigger callbacks. * @return $this Fluent Builder */ public function setCallbackEvents(string $callbackEvents): self { $this->options['callbackEvents'] = $callbackEvents; return $this; } /** * The JSON actions to be executed when the user's input is not recognized as matching any Task. * * @param array $fallbackActions The JSON actions to be executed when the * user's input is not recognized as matching any * Task. * @return $this Fluent Builder */ public function setFallbackActions(array $fallbackActions): self { $this->options['fallbackActions'] = $fallbackActions; return $this; } /** * The JSON actions to be executed on inbound phone calls when the Assistant has to say something first. * * @param array $initiationActions The JSON actions to be executed on inbound * phone calls when the Assistant has to say * something first. * @return $this Fluent Builder */ public function setInitiationActions(array $initiationActions): self { $this->options['initiationActions'] = $initiationActions; return $this; } /** * The JSON object that holds the style sheet for the assistant * * @param array $styleSheet The JSON object that holds the style sheet for the * assistant * @return $this Fluent Builder */ public function setStyleSheet(array $styleSheet): self { $this->options['styleSheet'] = $styleSheet; return $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.Understand.CreateAssistantOptions ' . $options . ']'; } } class UpdateAssistantOptions extends Options { /** * @param string $friendlyName A text description for the Assistant. It is * non-unique and can up to 255 characters long. * @param bool $logQueries A boolean that specifies whether queries should be * logged for 30 days further training. If false, no * queries will be stored, if true, queries will be * stored for 30 days and deleted thereafter. Defaults * to true if no value is provided. * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. * @param string $callbackUrl A user-provided URL to send event callbacks to. * @param string $callbackEvents Space-separated list of callback events that * will trigger callbacks. * @param array $fallbackActions The JSON actions to be executed when the * user's input is not recognized as matching any * Task. * @param array $initiationActions The JSON actions to be executed on inbound * phone calls when the Assistant has to say * something first. * @param array $styleSheet The JSON object that holds the style sheet for the * assistant */ public function __construct(string $friendlyName = Values::NONE, bool $logQueries = Values::NONE, string $uniqueName = Values::NONE, string $callbackUrl = Values::NONE, string $callbackEvents = Values::NONE, array $fallbackActions = Values::ARRAY_NONE, array $initiationActions = Values::ARRAY_NONE, array $styleSheet = Values::ARRAY_NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['logQueries'] = $logQueries; $this->options['uniqueName'] = $uniqueName; $this->options['callbackUrl'] = $callbackUrl; $this->options['callbackEvents'] = $callbackEvents; $this->options['fallbackActions'] = $fallbackActions; $this->options['initiationActions'] = $initiationActions; $this->options['styleSheet'] = $styleSheet; } /** * A text description for the Assistant. It is non-unique and can up to 255 characters long. * * @param string $friendlyName A text description for the Assistant. It is * non-unique and can up to 255 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided. * * @param bool $logQueries A boolean that specifies whether queries should be * logged for 30 days further training. If false, no * queries will be stored, if true, queries will be * stored for 30 days and deleted thereafter. Defaults * to true if no value is provided. * @return $this Fluent Builder */ public function setLogQueries(bool $logQueries): self { $this->options['logQueries'] = $logQueries; return $this; } /** * A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. * * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * A user-provided URL to send event callbacks to. * * @param string $callbackUrl A user-provided URL to send event callbacks to. * @return $this Fluent Builder */ public function setCallbackUrl(string $callbackUrl): self { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * Space-separated list of callback events that will trigger callbacks. * * @param string $callbackEvents Space-separated list of callback events that * will trigger callbacks. * @return $this Fluent Builder */ public function setCallbackEvents(string $callbackEvents): self { $this->options['callbackEvents'] = $callbackEvents; return $this; } /** * The JSON actions to be executed when the user's input is not recognized as matching any Task. * * @param array $fallbackActions The JSON actions to be executed when the * user's input is not recognized as matching any * Task. * @return $this Fluent Builder */ public function setFallbackActions(array $fallbackActions): self { $this->options['fallbackActions'] = $fallbackActions; return $this; } /** * The JSON actions to be executed on inbound phone calls when the Assistant has to say something first. * * @param array $initiationActions The JSON actions to be executed on inbound * phone calls when the Assistant has to say * something first. * @return $this Fluent Builder */ public function setInitiationActions(array $initiationActions): self { $this->options['initiationActions'] = $initiationActions; return $this; } /** * The JSON object that holds the style sheet for the assistant * * @param array $styleSheet The JSON object that holds the style sheet for the * assistant * @return $this Fluent Builder */ public function setStyleSheet(array $styleSheet): self { $this->options['styleSheet'] = $styleSheet; return $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.Understand.UpdateAssistantOptions ' . $options . ']'; } } Preview/Understand/AssistantPage.php 0000644 00000002553 15107452352 0013564 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AssistantPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return AssistantInstance \Twilio\Rest\Preview\Understand\AssistantInstance */ public function buildInstance(array $payload): AssistantInstance { return new AssistantInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Understand.AssistantPage]'; } } Preview/HostedNumbers.php 0000644 00000005610 15107452352 0011466 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Preview\HostedNumbers\AuthorizationDocumentList; use Twilio\Rest\Preview\HostedNumbers\HostedNumberOrderList; use Twilio\Version; /** * @property AuthorizationDocumentList $authorizationDocuments * @property HostedNumberOrderList $hostedNumberOrders * @method \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocumentContext authorizationDocuments(string $sid) * @method \Twilio\Rest\Preview\HostedNumbers\HostedNumberOrderContext hostedNumberOrders(string $sid) */ class HostedNumbers extends Version { protected $_authorizationDocuments; protected $_hostedNumberOrders; /** * Construct the HostedNumbers version of Preview * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->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]'; } } Preview/DeployedDevices.php 0000644 00000004333 15107452352 0011755 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Preview\DeployedDevices\FleetList; use Twilio\Version; /** * @property FleetList $fleets * @method \Twilio\Rest\Preview\DeployedDevices\FleetContext fleets(string $sid) */ class DeployedDevices extends Version { protected $_fleets; /** * Construct the DeployedDevices version of Preview * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->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]'; } } Preview/Marketplace.php 0000644 00000005400 15107452352 0011131 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Preview\Marketplace\AvailableAddOnList; use Twilio\Rest\Preview\Marketplace\InstalledAddOnList; use Twilio\Version; /** * @property AvailableAddOnList $availableAddOns * @property InstalledAddOnList $installedAddOns * @method \Twilio\Rest\Preview\Marketplace\AvailableAddOnContext availableAddOns(string $sid) * @method \Twilio\Rest\Preview\Marketplace\InstalledAddOnContext installedAddOns(string $sid) */ class Marketplace extends Version { protected $_availableAddOns; protected $_installedAddOns; /** * Construct the Marketplace version of Preview * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->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]'; } } Preview/Wireless/SimPage.php 0000644 00000002501 15107452352 0012022 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SimPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Preview/Wireless/CommandList.php 0000644 00000014200 15107452352 0012706 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class CommandList extends ListResource { /** * Construct the CommandList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Commands'; } /** * Streams CommandInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of CommandInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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); } /** * Create the CommandInstance * * @param string $command The 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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CommandInstance($this->version, $payload); } /** * Constructs a CommandContext * * @param string $sid The 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]'; } } Preview/Wireless/CommandContext.php 0000644 00000003206 15107452352 0013423 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class CommandContext extends InstanceContext { /** * Initialize the CommandContext * * @param Version $version Version that contains the resource * @param string $sid The sid */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Preview/Wireless/RatePlanInstance.php 0000644 00000011530 15107452352 0013672 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $uniqueName * @property string $accountSid * @property string $friendlyName * @property bool $dataEnabled * @property string $dataMetering * @property int $dataLimit * @property bool $messagingEnabled * @property bool $voiceEnabled * @property bool $nationalRoamingEnabled * @property string[] $internationalRoaming * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class RatePlanInstance extends InstanceResource { /** * Initialize the RatePlanInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The sid */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Preview/Wireless/SimList.php 0000644 00000012266 15107452352 0012072 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SimList extends ListResource { /** * Construct the SimList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Sims'; } /** * Streams SimInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of SimInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 */ 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]'; } } Preview/Wireless/CommandPage.php 0000644 00000002531 15107452352 0012653 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class CommandPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Preview/Wireless/CommandInstance.php 0000644 00000007425 15107452352 0013552 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $accountSid * @property string $deviceSid * @property string $simSid * @property string $command * @property string $commandMode * @property string $status * @property string $direction * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class CommandInstance extends InstanceResource { /** * Initialize the CommandInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The sid */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Preview/Wireless/SimInstance.php 0000644 00000012775 15107452352 0012730 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Preview\Wireless\Sim\UsageList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $uniqueName * @property string $accountSid * @property string $ratePlanSid * @property string $friendlyName * @property string $iccid * @property string $eId * @property string $status * @property string $commandsCallbackUrl * @property string $commandsCallbackMethod * @property string $smsFallbackMethod * @property string $smsFallbackUrl * @property string $smsMethod * @property string $smsUrl * @property string $voiceFallbackMethod * @property string $voiceFallbackUrl * @property string $voiceMethod * @property string $voiceUrl * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class SimInstance extends InstanceResource { protected $_usage; /** * Initialize the SimInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The sid */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Preview/Wireless/RatePlanContext.php 0000644 00000005117 15107452352 0013556 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class RatePlanContext extends InstanceContext { /** * Initialize the RatePlanContext * * @param Version $version Version that contains the resource * @param string $sid The sid */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/RatePlans/' . \rawurlencode($sid) . ''; } /** * Fetch the RatePlanInstance * * @return RatePlanInstance Fetched RatePlanInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RatePlanInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new RatePlanInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the RatePlanInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Preview/Wireless/SimContext.php 0000644 00000011070 15107452352 0012573 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Preview\Wireless\Sim\UsageList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property UsageList $usage * @method \Twilio\Rest\Preview\Wireless\Sim\UsageContext usage() */ class SimContext extends InstanceContext { protected $_usage; /** * Initialize the SimContext * * @param Version $version Version that contains the resource * @param string $sid The sid */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } Preview/Wireless/SimOptions.php 0000644 00000030746 15107452352 0012615 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class SimOptions { /** * @param string $status The status * @param string $iccid The iccid * @param string $ratePlan The rate_plan * @param string $eId The e_id * @param string $simRegistrationCode The sim_registration_code * @return ReadSimOptions Options builder */ public static function read(string $status = Values::NONE, string $iccid = Values::NONE, string $ratePlan = Values::NONE, string $eId = Values::NONE, string $simRegistrationCode = Values::NONE): ReadSimOptions { return new ReadSimOptions($status, $iccid, $ratePlan, $eId, $simRegistrationCode); } /** * @param string $uniqueName The unique_name * @param string $callbackMethod The callback_method * @param string $callbackUrl The callback_url * @param string $friendlyName The friendly_name * @param string $ratePlan The rate_plan * @param string $status The status * @param string $commandsCallbackMethod The commands_callback_method * @param string $commandsCallbackUrl The commands_callback_url * @param string $smsFallbackMethod The sms_fallback_method * @param string $smsFallbackUrl The sms_fallback_url * @param string $smsMethod The sms_method * @param string $smsUrl The sms_url * @param string $voiceFallbackMethod The voice_fallback_method * @param string $voiceFallbackUrl The voice_fallback_url * @param string $voiceMethod The voice_method * @param string $voiceUrl The voice_url * @return UpdateSimOptions Options builder */ public static function update(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): UpdateSimOptions { return new UpdateSimOptions($uniqueName, $callbackMethod, $callbackUrl, $friendlyName, $ratePlan, $status, $commandsCallbackMethod, $commandsCallbackUrl, $smsFallbackMethod, $smsFallbackUrl, $smsMethod, $smsUrl, $voiceFallbackMethod, $voiceFallbackUrl, $voiceMethod, $voiceUrl); } } class ReadSimOptions extends Options { /** * @param string $status The status * @param string $iccid The iccid * @param string $ratePlan The rate_plan * @param string $eId The e_id * @param string $simRegistrationCode The sim_registration_code */ public function __construct(string $status = Values::NONE, string $iccid = Values::NONE, string $ratePlan = Values::NONE, string $eId = Values::NONE, string $simRegistrationCode = Values::NONE) { $this->options['status'] = $status; $this->options['iccid'] = $iccid; $this->options['ratePlan'] = $ratePlan; $this->options['eId'] = $eId; $this->options['simRegistrationCode'] = $simRegistrationCode; } /** * The status * * @param string $status The status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * The iccid * * @param string $iccid The iccid * @return $this Fluent Builder */ public function setIccid(string $iccid): self { $this->options['iccid'] = $iccid; return $this; } /** * The rate_plan * * @param string $ratePlan The rate_plan * @return $this Fluent Builder */ public function setRatePlan(string $ratePlan): self { $this->options['ratePlan'] = $ratePlan; return $this; } /** * The e_id * * @param string $eId The e_id * @return $this Fluent Builder */ public function setEId(string $eId): self { $this->options['eId'] = $eId; return $this; } /** * The sim_registration_code * * @param string $simRegistrationCode The sim_registration_code * @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 The unique_name * @param string $callbackMethod The callback_method * @param string $callbackUrl The callback_url * @param string $friendlyName The friendly_name * @param string $ratePlan The rate_plan * @param string $status The status * @param string $commandsCallbackMethod The commands_callback_method * @param string $commandsCallbackUrl The commands_callback_url * @param string $smsFallbackMethod The sms_fallback_method * @param string $smsFallbackUrl The sms_fallback_url * @param string $smsMethod The sms_method * @param string $smsUrl The sms_url * @param string $voiceFallbackMethod The voice_fallback_method * @param string $voiceFallbackUrl The voice_fallback_url * @param string $voiceMethod The voice_method * @param string $voiceUrl The voice_url */ public function __construct(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; } /** * The unique_name * * @param string $uniqueName The unique_name * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The callback_method * * @param string $callbackMethod The callback_method * @return $this Fluent Builder */ public function setCallbackMethod(string $callbackMethod): self { $this->options['callbackMethod'] = $callbackMethod; return $this; } /** * The callback_url * * @param string $callbackUrl The callback_url * @return $this Fluent Builder */ public function setCallbackUrl(string $callbackUrl): self { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The rate_plan * * @param string $ratePlan The rate_plan * @return $this Fluent Builder */ public function setRatePlan(string $ratePlan): self { $this->options['ratePlan'] = $ratePlan; return $this; } /** * The status * * @param string $status The status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * The commands_callback_method * * @param string $commandsCallbackMethod The commands_callback_method * @return $this Fluent Builder */ public function setCommandsCallbackMethod(string $commandsCallbackMethod): self { $this->options['commandsCallbackMethod'] = $commandsCallbackMethod; return $this; } /** * The commands_callback_url * * @param string $commandsCallbackUrl The commands_callback_url * @return $this Fluent Builder */ public function setCommandsCallbackUrl(string $commandsCallbackUrl): self { $this->options['commandsCallbackUrl'] = $commandsCallbackUrl; return $this; } /** * The sms_fallback_method * * @param string $smsFallbackMethod The sms_fallback_method * @return $this Fluent Builder */ public function setSmsFallbackMethod(string $smsFallbackMethod): self { $this->options['smsFallbackMethod'] = $smsFallbackMethod; return $this; } /** * The sms_fallback_url * * @param string $smsFallbackUrl The sms_fallback_url * @return $this Fluent Builder */ public function setSmsFallbackUrl(string $smsFallbackUrl): self { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * The sms_method * * @param string $smsMethod The sms_method * @return $this Fluent Builder */ public function setSmsMethod(string $smsMethod): self { $this->options['smsMethod'] = $smsMethod; return $this; } /** * The sms_url * * @param string $smsUrl The sms_url * @return $this Fluent Builder */ public function setSmsUrl(string $smsUrl): self { $this->options['smsUrl'] = $smsUrl; return $this; } /** * The voice_fallback_method * * @param string $voiceFallbackMethod The voice_fallback_method * @return $this Fluent Builder */ public function setVoiceFallbackMethod(string $voiceFallbackMethod): self { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The voice_fallback_url * * @param string $voiceFallbackUrl The voice_fallback_url * @return $this Fluent Builder */ public function setVoiceFallbackUrl(string $voiceFallbackUrl): self { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The voice_method * * @param string $voiceMethod The voice_method * @return $this Fluent Builder */ public function setVoiceMethod(string $voiceMethod): self { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The voice_url * * @param string $voiceUrl The voice_url * @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 . ']'; } } Preview/Wireless/RatePlanList.php 0000644 00000014060 15107452352 0013042 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class RatePlanList extends ListResource { /** * Construct the RatePlanList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/RatePlans'; } /** * Streams RatePlanInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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); } /** * 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; }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new RatePlanInstance($this->version, $payload); } /** * Constructs a RatePlanContext * * @param string $sid The 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]'; } } Preview/Wireless/RatePlanPage.php 0000644 00000002537 15107452352 0013011 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class RatePlanPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Preview/Wireless/RatePlanOptions.php 0000644 00000020213 15107452352 0013557 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class RatePlanOptions { /** * @param string $uniqueName The unique_name * @param string $friendlyName The friendly_name * @param bool $dataEnabled The data_enabled * @param int $dataLimit The data_limit * @param string $dataMetering The data_metering * @param bool $messagingEnabled The messaging_enabled * @param bool $voiceEnabled The voice_enabled * @param bool $commandsEnabled The commands_enabled * @param bool $nationalRoamingEnabled The national_roaming_enabled * @param string[] $internationalRoaming The international_roaming * @return CreateRatePlanOptions Options builder */ public static function create(string $uniqueName = Values::NONE, string $friendlyName = Values::NONE, bool $dataEnabled = Values::NONE, int $dataLimit = Values::NONE, string $dataMetering = Values::NONE, bool $messagingEnabled = Values::NONE, bool $voiceEnabled = Values::NONE, bool $commandsEnabled = Values::NONE, bool $nationalRoamingEnabled = Values::NONE, array $internationalRoaming = Values::ARRAY_NONE): CreateRatePlanOptions { return new CreateRatePlanOptions($uniqueName, $friendlyName, $dataEnabled, $dataLimit, $dataMetering, $messagingEnabled, $voiceEnabled, $commandsEnabled, $nationalRoamingEnabled, $internationalRoaming); } /** * @param string $uniqueName The unique_name * @param string $friendlyName The friendly_name * @return UpdateRatePlanOptions Options builder */ public static function update(string $uniqueName = Values::NONE, string $friendlyName = Values::NONE): UpdateRatePlanOptions { return new UpdateRatePlanOptions($uniqueName, $friendlyName); } } class CreateRatePlanOptions extends Options { /** * @param string $uniqueName The unique_name * @param string $friendlyName The friendly_name * @param bool $dataEnabled The data_enabled * @param int $dataLimit The data_limit * @param string $dataMetering The data_metering * @param bool $messagingEnabled The messaging_enabled * @param bool $voiceEnabled The voice_enabled * @param bool $commandsEnabled The commands_enabled * @param bool $nationalRoamingEnabled The national_roaming_enabled * @param string[] $internationalRoaming The international_roaming */ public function __construct(string $uniqueName = Values::NONE, string $friendlyName = Values::NONE, bool $dataEnabled = Values::NONE, int $dataLimit = Values::NONE, string $dataMetering = Values::NONE, bool $messagingEnabled = Values::NONE, bool $voiceEnabled = Values::NONE, bool $commandsEnabled = Values::NONE, bool $nationalRoamingEnabled = Values::NONE, array $internationalRoaming = Values::ARRAY_NONE) { $this->options['uniqueName'] = $uniqueName; $this->options['friendlyName'] = $friendlyName; $this->options['dataEnabled'] = $dataEnabled; $this->options['dataLimit'] = $dataLimit; $this->options['dataMetering'] = $dataMetering; $this->options['messagingEnabled'] = $messagingEnabled; $this->options['voiceEnabled'] = $voiceEnabled; $this->options['commandsEnabled'] = $commandsEnabled; $this->options['nationalRoamingEnabled'] = $nationalRoamingEnabled; $this->options['internationalRoaming'] = $internationalRoaming; } /** * The unique_name * * @param string $uniqueName The unique_name * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The data_enabled * * @param bool $dataEnabled The data_enabled * @return $this Fluent Builder */ public function setDataEnabled(bool $dataEnabled): self { $this->options['dataEnabled'] = $dataEnabled; return $this; } /** * The data_limit * * @param int $dataLimit The data_limit * @return $this Fluent Builder */ public function setDataLimit(int $dataLimit): self { $this->options['dataLimit'] = $dataLimit; return $this; } /** * The data_metering * * @param string $dataMetering The data_metering * @return $this Fluent Builder */ public function setDataMetering(string $dataMetering): self { $this->options['dataMetering'] = $dataMetering; return $this; } /** * The messaging_enabled * * @param bool $messagingEnabled The messaging_enabled * @return $this Fluent Builder */ public function setMessagingEnabled(bool $messagingEnabled): self { $this->options['messagingEnabled'] = $messagingEnabled; return $this; } /** * The voice_enabled * * @param bool $voiceEnabled The voice_enabled * @return $this Fluent Builder */ public function setVoiceEnabled(bool $voiceEnabled): self { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * The commands_enabled * * @param bool $commandsEnabled The commands_enabled * @return $this Fluent Builder */ public function setCommandsEnabled(bool $commandsEnabled): self { $this->options['commandsEnabled'] = $commandsEnabled; return $this; } /** * The national_roaming_enabled * * @param bool $nationalRoamingEnabled The national_roaming_enabled * @return $this Fluent Builder */ public function setNationalRoamingEnabled(bool $nationalRoamingEnabled): self { $this->options['nationalRoamingEnabled'] = $nationalRoamingEnabled; return $this; } /** * The international_roaming * * @param string[] $internationalRoaming The international_roaming * @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 The unique_name * @param string $friendlyName The friendly_name */ public function __construct(string $uniqueName = Values::NONE, string $friendlyName = Values::NONE) { $this->options['uniqueName'] = $uniqueName; $this->options['friendlyName'] = $friendlyName; } /** * The unique_name * * @param string $uniqueName The unique_name * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The friendly_name * * @param string $friendlyName The 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.Preview.Wireless.UpdateRatePlanOptions ' . $options . ']'; } } Preview/Wireless/Sim/UsageList.php 0000644 00000002265 15107452352 0013134 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless\Sim; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class UsageList extends ListResource { /** * Construct the UsageList * * @param Version $version Version that contains the resource * @param string $simSid The sim_sid */ public function __construct(Version $version, string $simSid) { parent::__construct($version); // Path Solution $this->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]'; } } Preview/Wireless/Sim/UsageInstance.php 0000644 00000007155 15107452352 0013770 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless\Sim; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $simSid * @property string $simUniqueName * @property string $accountSid * @property array $period * @property array $commandsUsage * @property array $commandsCosts * @property array $dataUsage * @property array $dataCosts * @property string $url */ class UsageInstance extends InstanceResource { /** * Initialize the UsageInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $simSid The sim_sid */ public function __construct(Version $version, array $payload, string $simSid) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Preview/Wireless/Sim/UsageContext.php 0000644 00000003577 15107452352 0013654 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless\Sim; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class UsageContext extends InstanceContext { /** * Initialize the UsageContext * * @param Version $version Version that contains the resource * @param string $simSid The sim_sid */ public function __construct(Version $version, $simSid) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->fetch('GET', $this->uri, $params); return new UsageInstance($this->version, $payload, $this->solution['simSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Wireless.UsageContext ' . \implode(' ', $context) . ']'; } } Preview/Wireless/Sim/UsageOptions.php 0000644 00000003454 15107452352 0013655 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless\Sim; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class UsageOptions { /** * @param string $end The end * @param string $start The start * @return FetchUsageOptions Options builder */ public static function fetch(string $end = Values::NONE, string $start = Values::NONE): FetchUsageOptions { return new FetchUsageOptions($end, $start); } } class FetchUsageOptions extends Options { /** * @param string $end The end * @param string $start The start */ public function __construct(string $end = Values::NONE, string $start = Values::NONE) { $this->options['end'] = $end; $this->options['start'] = $start; } /** * The end * * @param string $end The end * @return $this Fluent Builder */ public function setEnd(string $end): self { $this->options['end'] = $end; return $this; } /** * The start * * @param string $start The 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 . ']'; } } Preview/Wireless/Sim/UsagePage.php 0000644 00000002560 15107452352 0013073 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless\Sim; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class UsagePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Preview/Wireless/CommandOptions.php 0000644 00000014301 15107452352 0013430 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class CommandOptions { /** * @param string $device The device * @param string $sim The sim * @param string $status The status * @param string $direction The direction * @return ReadCommandOptions Options builder */ public static function read(string $device = Values::NONE, string $sim = Values::NONE, string $status = Values::NONE, string $direction = Values::NONE): ReadCommandOptions { return new ReadCommandOptions($device, $sim, $status, $direction); } /** * @param string $device The device * @param string $sim The sim * @param string $callbackMethod The callback_method * @param string $callbackUrl The callback_url * @param string $commandMode The command_mode * @param string $includeSid The include_sid * @return CreateCommandOptions Options builder */ public static function create(string $device = Values::NONE, string $sim = Values::NONE, string $callbackMethod = Values::NONE, string $callbackUrl = Values::NONE, string $commandMode = Values::NONE, string $includeSid = Values::NONE): CreateCommandOptions { return new CreateCommandOptions($device, $sim, $callbackMethod, $callbackUrl, $commandMode, $includeSid); } } class ReadCommandOptions extends Options { /** * @param string $device The device * @param string $sim The sim * @param string $status The status * @param string $direction The direction */ public function __construct(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; } /** * The device * * @param string $device The device * @return $this Fluent Builder */ public function setDevice(string $device): self { $this->options['device'] = $device; return $this; } /** * The sim * * @param string $sim The sim * @return $this Fluent Builder */ public function setSim(string $sim): self { $this->options['sim'] = $sim; return $this; } /** * The status * * @param string $status The status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * The direction * * @param string $direction The 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 . ']'; } } class CreateCommandOptions extends Options { /** * @param string $device The device * @param string $sim The sim * @param string $callbackMethod The callback_method * @param string $callbackUrl The callback_url * @param string $commandMode The command_mode * @param string $includeSid The include_sid */ public function __construct(string $device = Values::NONE, string $sim = Values::NONE, string $callbackMethod = Values::NONE, string $callbackUrl = Values::NONE, string $commandMode = Values::NONE, string $includeSid = Values::NONE) { $this->options['device'] = $device; $this->options['sim'] = $sim; $this->options['callbackMethod'] = $callbackMethod; $this->options['callbackUrl'] = $callbackUrl; $this->options['commandMode'] = $commandMode; $this->options['includeSid'] = $includeSid; } /** * The device * * @param string $device The device * @return $this Fluent Builder */ public function setDevice(string $device): self { $this->options['device'] = $device; return $this; } /** * The sim * * @param string $sim The sim * @return $this Fluent Builder */ public function setSim(string $sim): self { $this->options['sim'] = $sim; return $this; } /** * The callback_method * * @param string $callbackMethod The callback_method * @return $this Fluent Builder */ public function setCallbackMethod(string $callbackMethod): self { $this->options['callbackMethod'] = $callbackMethod; return $this; } /** * The callback_url * * @param string $callbackUrl The callback_url * @return $this Fluent Builder */ public function setCallbackUrl(string $callbackUrl): self { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * The command_mode * * @param string $commandMode The command_mode * @return $this Fluent Builder */ public function setCommandMode(string $commandMode): self { $this->options['commandMode'] = $commandMode; return $this; } /** * The include_sid * * @param string $includeSid The include_sid * @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 . ']'; } } Pricing.php 0000644 00000007720 15107452352 0006662 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Pricing\V1; use Twilio\Rest\Pricing\V2; /** * @property \Twilio\Rest\Pricing\V1 $v1 * @property \Twilio\Rest\Pricing\V2 $v2 * @property \Twilio\Rest\Pricing\V1\MessagingList $messaging * @property \Twilio\Rest\Pricing\V1\PhoneNumberList $phoneNumbers * @property \Twilio\Rest\Pricing\V2\VoiceList $voice * @property \Twilio\Rest\Pricing\V2\CountryList $countries * @property \Twilio\Rest\Pricing\V2\NumberList $numbers * @method \Twilio\Rest\Pricing\V2\CountryContext countries(string $isoCountry) * @method \Twilio\Rest\Pricing\V2\NumberContext numbers(string $destinationNumber) */ class Pricing extends Domain { protected $_v1; protected $_v2; /** * Construct the Pricing Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->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); } protected function getMessaging(): \Twilio\Rest\Pricing\V1\MessagingList { return $this->v1->messaging; } protected function getPhoneNumbers(): \Twilio\Rest\Pricing\V1\PhoneNumberList { return $this->v1->phoneNumbers; } protected function getVoice(): \Twilio\Rest\Pricing\V2\VoiceList { return $this->v2->voice; } protected function getCountries(): \Twilio\Rest\Pricing\V2\CountryList { return $this->v2->countries; } /** * @param string $isoCountry The ISO country code of the pricing information to * fetch */ protected function contextCountries(string $isoCountry): \Twilio\Rest\Pricing\V2\CountryContext { return $this->v2->countries($isoCountry); } protected function getNumbers(): \Twilio\Rest\Pricing\V2\NumberList { return $this->v2->numbers; } /** * @param string $destinationNumber The destination number for which to fetch * pricing information */ protected function contextNumbers(string $destinationNumber): \Twilio\Rest\Pricing\V2\NumberContext { return $this->v2->numbers($destinationNumber); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing]'; } } Studio.php 0000644 00000005661 15107452352 0006540 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Studio\V1; use Twilio\Rest\Studio\V2; /** * @property \Twilio\Rest\Studio\V1 $v1 * @property \Twilio\Rest\Studio\V2 $v2 * @property \Twilio\Rest\Studio\V2\FlowList $flows * @property \Twilio\Rest\Studio\V2\FlowValidateList $flowValidate * @method \Twilio\Rest\Studio\V2\FlowContext flows(string $sid) */ class Studio extends Domain { protected $_v1; protected $_v2; /** * Construct the Studio Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->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); } protected function getFlows(): \Twilio\Rest\Studio\V2\FlowList { return $this->v2->flows; } /** * @param string $sid The SID that identifies the resource to fetch */ protected function contextFlows(string $sid): \Twilio\Rest\Studio\V2\FlowContext { return $this->v2->flows($sid); } protected function getFlowValidate(): \Twilio\Rest\Studio\V2\FlowValidateList { return $this->v2->flowValidate; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio]'; } } Video/V1/RoomList.php 0000644 00000015252 15107452352 0010372 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class RoomList extends ListResource { /** * Construct the RoomList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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' => Serialize::map($options['videoCodecs'], function($e) { return $e; }), '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']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new RoomInstance($this->version, $payload); } /** * Streams RoomInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of RoomInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 that identifies the 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]'; } } Video/V1/CompositionSettingsInstance.php 0000644 00000007702 15107452352 0014334 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $friendlyName * @property string $awsCredentialsSid * @property string $awsS3Url * @property bool $awsStorageEnabled * @property string $encryptionKeySid * @property bool $encryptionEnabled * @property string $url */ class CompositionSettingsInstance extends InstanceResource { /** * Initialize the CompositionSettingsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the CompositionSettingsInstance * * @return CompositionSettingsInstance Fetched CompositionSettingsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CompositionSettingsInstance { return $this->proxy()->fetch(); } /** * Create the CompositionSettingsInstance * * @param string $friendlyName A descriptive string that you create to describe * the resource * @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); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Video/V1/CompositionSettingsOptions.php 0000644 00000012415 15107452352 0014220 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Options; use Twilio\Values; abstract class CompositionSettingsOptions { /** * @param string $awsCredentialsSid The SID of the stored Credential resource * @param string $encryptionKeySid The SID of the Public Key resource to use * for encryption * @param string $awsS3Url The URL of the AWS S3 bucket where the compositions * should be stored * @param bool $awsStorageEnabled Whether all compositions should be written to * the aws_s3_url * @param bool $encryptionEnabled Whether all compositions should be stored in * an encrypted form * @return CreateCompositionSettingsOptions Options builder */ public static function create(string $awsCredentialsSid = Values::NONE, string $encryptionKeySid = Values::NONE, string $awsS3Url = Values::NONE, bool $awsStorageEnabled = Values::NONE, bool $encryptionEnabled = Values::NONE): CreateCompositionSettingsOptions { return new CreateCompositionSettingsOptions($awsCredentialsSid, $encryptionKeySid, $awsS3Url, $awsStorageEnabled, $encryptionEnabled); } } class CreateCompositionSettingsOptions extends Options { /** * @param string $awsCredentialsSid The SID of the stored Credential resource * @param string $encryptionKeySid The SID of the Public Key resource to use * for encryption * @param string $awsS3Url The URL of the AWS S3 bucket where the compositions * should be stored * @param bool $awsStorageEnabled Whether all compositions should be written to * the aws_s3_url * @param bool $encryptionEnabled Whether all compositions should be stored in * an encrypted form */ public function __construct(string $awsCredentialsSid = Values::NONE, string $encryptionKeySid = Values::NONE, string $awsS3Url = Values::NONE, bool $awsStorageEnabled = Values::NONE, bool $encryptionEnabled = Values::NONE) { $this->options['awsCredentialsSid'] = $awsCredentialsSid; $this->options['encryptionKeySid'] = $encryptionKeySid; $this->options['awsS3Url'] = $awsS3Url; $this->options['awsStorageEnabled'] = $awsStorageEnabled; $this->options['encryptionEnabled'] = $encryptionEnabled; } /** * The SID of the stored Credential resource. * * @param string $awsCredentialsSid The SID of the stored Credential resource * @return $this Fluent Builder */ public function setAwsCredentialsSid(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 <a href='https://tools.ietf.org/html/rfc3986#section-2'>RFC 3986</a>. * * @param string $awsS3Url The URL of the AWS S3 bucket where the compositions * should be stored * @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 * @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 * @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 . ']'; } } Video/V1/RoomContext.php 0000644 00000010707 15107452352 0011103 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Video\V1\Room\ParticipantList; use Twilio\Rest\Video\V1\Room\RecordingRulesList; use Twilio\Rest\Video\V1\Room\RoomRecordingList; use Twilio\Values; use Twilio\Version; /** * @property RoomRecordingList $recordings * @property ParticipantList $participants * @property RecordingRulesList $recordingRules * @method \Twilio\Rest\Video\V1\Room\RoomRecordingContext recordings(string $sid) * @method \Twilio\Rest\Video\V1\Room\ParticipantContext participants(string $sid) */ class RoomContext extends InstanceContext { protected $_recordings; protected $_participants; protected $_recordingRules; /** * Initialize the RoomContext * * @param Version $version Version that contains the resource * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); return new RoomInstance($this->version, $payload, $this->solution['sid']); } /** * Update the RoomInstance * * @param string $status The new status of the resource * @return RoomInstance Updated RoomInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status): RoomInstance { $data = Values::of(['Status' => $status, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new RoomInstance($this->version, $payload, $this->solution['sid']); } /** * Access the recordings */ protected function getRecordings(): RoomRecordingList { if (!$this->_recordings) { $this->_recordings = new RoomRecordingList($this->version, $this->solution['sid']); } return $this->_recordings; } /** * Access the participants */ protected function getParticipants(): ParticipantList { if (!$this->_participants) { $this->_participants = new ParticipantList($this->version, $this->solution['sid']); } return $this->_participants; } /** * Access the recordingRules */ protected function getRecordingRules(): RecordingRulesList { if (!$this->_recordingRules) { $this->_recordingRules = new RecordingRulesList($this->version, $this->solution['sid']); } return $this->_recordingRules; } /** * 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) . ']'; } } Video/V1/RecordingSettingsOptions.php 0000644 00000012341 15107452352 0013627 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Options; use Twilio\Values; abstract class RecordingSettingsOptions { /** * @param string $awsCredentialsSid The SID of the stored Credential resource * @param string $encryptionKeySid The SID of the Public Key resource to use * for encryption * @param string $awsS3Url The URL of the AWS S3 bucket where the recordings * should be stored * @param bool $awsStorageEnabled Whether all recordings should be written to * the aws_s3_url * @param bool $encryptionEnabled Whether all recordings should be stored in an * encrypted form * @return CreateRecordingSettingsOptions Options builder */ public static function create(string $awsCredentialsSid = Values::NONE, string $encryptionKeySid = Values::NONE, string $awsS3Url = Values::NONE, bool $awsStorageEnabled = Values::NONE, bool $encryptionEnabled = Values::NONE): CreateRecordingSettingsOptions { return new CreateRecordingSettingsOptions($awsCredentialsSid, $encryptionKeySid, $awsS3Url, $awsStorageEnabled, $encryptionEnabled); } } class CreateRecordingSettingsOptions extends Options { /** * @param string $awsCredentialsSid The SID of the stored Credential resource * @param string $encryptionKeySid The SID of the Public Key resource to use * for encryption * @param string $awsS3Url The URL of the AWS S3 bucket where the recordings * should be stored * @param bool $awsStorageEnabled Whether all recordings should be written to * the aws_s3_url * @param bool $encryptionEnabled Whether all recordings should be stored in an * encrypted form */ public function __construct(string $awsCredentialsSid = Values::NONE, string $encryptionKeySid = Values::NONE, string $awsS3Url = Values::NONE, bool $awsStorageEnabled = Values::NONE, bool $encryptionEnabled = Values::NONE) { $this->options['awsCredentialsSid'] = $awsCredentialsSid; $this->options['encryptionKeySid'] = $encryptionKeySid; $this->options['awsS3Url'] = $awsS3Url; $this->options['awsStorageEnabled'] = $awsStorageEnabled; $this->options['encryptionEnabled'] = $encryptionEnabled; } /** * The SID of the stored Credential resource. * * @param string $awsCredentialsSid The SID of the stored Credential resource * @return $this Fluent Builder */ public function setAwsCredentialsSid(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 <a href='https://tools.ietf.org/html/rfc3986#section-2'>RFC 3986</a>. * * @param string $awsS3Url The URL of the AWS S3 bucket where the recordings * should be stored * @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 * @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 * @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 . ']'; } } Video/V1/RecordingList.php 0000644 00000012512 15107452352 0011366 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class RecordingList extends ListResource { /** * Construct the RecordingList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Recordings'; } /** * Streams RecordingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of RecordingInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 that identifies the resource to fetch */ 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]'; } } Video/V1/RoomOptions.php 0000644 00000042760 15107452352 0011116 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Options; use Twilio\Values; abstract class RoomOptions { /** * @param bool $enableTurn Enable Twilio's Network Traversal TURN service * @param string $type The type of room * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $statusCallback The URL to send status information to your * application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @param int $maxParticipants The maximum number of concurrent Participants * allowed in the room * @param bool $recordParticipantsOnConnect Whether to start recording when * Participants connect * @param string[] $videoCodecs An array of the video codecs that are supported * when publishing a track in the room * @param string $mediaRegion The region for the media server in Group Rooms * @param array $recordingRules A collection of Recording Rules * @param bool $audioOnly Indicates whether the room will only contain audio * track participants for group rooms. * @param int $maxParticipantDuration The maximum number of seconds a * Participant can be connected to the room * @param int $emptyRoomTimeout Configures the time a room will remain active * after last participant leaves. * @param int $unusedRoomTimeout Configures the time a room will remain active * when no one joins. * @param bool $largeRoom Indicates whether this is a large room. * @return CreateRoomOptions Options builder */ public static function create(bool $enableTurn = Values::NONE, string $type = Values::NONE, string $uniqueName = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, int $maxParticipants = Values::NONE, bool $recordParticipantsOnConnect = Values::NONE, array $videoCodecs = Values::ARRAY_NONE, string $mediaRegion = Values::NONE, array $recordingRules = Values::ARRAY_NONE, bool $audioOnly = Values::NONE, int $maxParticipantDuration = Values::NONE, int $emptyRoomTimeout = Values::NONE, int $unusedRoomTimeout = Values::NONE, bool $largeRoom = Values::NONE): CreateRoomOptions { return new CreateRoomOptions($enableTurn, $type, $uniqueName, $statusCallback, $statusCallbackMethod, $maxParticipants, $recordParticipantsOnConnect, $videoCodecs, $mediaRegion, $recordingRules, $audioOnly, $maxParticipantDuration, $emptyRoomTimeout, $unusedRoomTimeout, $largeRoom); } /** * @param string $status Read only the rooms with this status * @param string $uniqueName Read only rooms with this unique_name * @param \DateTime $dateCreatedAfter Read only rooms that started on or after * this date, given as YYYY-MM-DD * @param \DateTime $dateCreatedBefore Read only rooms that started before this * date, given as YYYY-MM-DD * @return ReadRoomOptions Options builder */ public static function read(string $status = Values::NONE, string $uniqueName = Values::NONE, \DateTime $dateCreatedAfter = Values::NONE, \DateTime $dateCreatedBefore = Values::NONE): ReadRoomOptions { return new ReadRoomOptions($status, $uniqueName, $dateCreatedAfter, $dateCreatedBefore); } } class CreateRoomOptions extends Options { /** * @param bool $enableTurn Enable Twilio's Network Traversal TURN service * @param string $type The type of room * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $statusCallback The URL to send status information to your * application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @param int $maxParticipants The maximum number of concurrent Participants * allowed in the room * @param bool $recordParticipantsOnConnect Whether to start recording when * Participants connect * @param string[] $videoCodecs An array of the video codecs that are supported * when publishing a track in the room * @param string $mediaRegion The region for the media server in Group Rooms * @param array $recordingRules A collection of Recording Rules * @param bool $audioOnly Indicates whether the room will only contain audio * track participants for group rooms. * @param int $maxParticipantDuration The maximum number of seconds a * Participant can be connected to the room * @param int $emptyRoomTimeout Configures the time a room will remain active * after last participant leaves. * @param int $unusedRoomTimeout Configures the time a room will remain active * when no one joins. * @param bool $largeRoom Indicates whether this is a large room. */ public function __construct(bool $enableTurn = Values::NONE, string $type = Values::NONE, string $uniqueName = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, int $maxParticipants = Values::NONE, bool $recordParticipantsOnConnect = Values::NONE, array $videoCodecs = Values::ARRAY_NONE, string $mediaRegion = Values::NONE, array $recordingRules = Values::ARRAY_NONE, bool $audioOnly = Values::NONE, int $maxParticipantDuration = Values::NONE, int $emptyRoomTimeout = Values::NONE, int $unusedRoomTimeout = Values::NONE, bool $largeRoom = Values::NONE) { $this->options['enableTurn'] = $enableTurn; $this->options['type'] = $type; $this->options['uniqueName'] = $uniqueName; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['maxParticipants'] = $maxParticipants; $this->options['recordParticipantsOnConnect'] = $recordParticipantsOnConnect; $this->options['videoCodecs'] = $videoCodecs; $this->options['mediaRegion'] = $mediaRegion; $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 Enable Twilio's Network Traversal TURN service * @return $this Fluent Builder */ public function setEnableTurn(bool $enableTurn): self { $this->options['enableTurn'] = $enableTurn; return $this; } /** * The type of room. Can be: `go`, `peer-to-peer`, `group-small`, or `group`. The default value is `group`. * * @param string $type The type of room * @return $this Fluent Builder */ public function setType(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 * @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 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`. * * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @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 * @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 * @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 * @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-address-whitelisting#group-rooms-media-servers). ***This feature is not available in `peer-to-peer` rooms.*** * * @param string $mediaRegion The region for the media server in Group Rooms * @return $this Fluent Builder */ public function setMediaRegion(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 * @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 Indicates whether the room will only contain audio * track participants for group rooms. * @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 * @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 the time a room will remain active * after last participant leaves. * @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 the time a room will remain active * when no one joins. * @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 Indicates whether this is a 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 * @param string $uniqueName Read only rooms with this unique_name * @param \DateTime $dateCreatedAfter Read only rooms that started on or after * this date, given as YYYY-MM-DD * @param \DateTime $dateCreatedBefore Read only rooms that started before this * date, given as YYYY-MM-DD */ public function __construct(string $status = Values::NONE, string $uniqueName = Values::NONE, \DateTime $dateCreatedAfter = Values::NONE, \DateTime $dateCreatedBefore = Values::NONE) { $this->options['status'] = $status; $this->options['uniqueName'] = $uniqueName; $this->options['dateCreatedAfter'] = $dateCreatedAfter; $this->options['dateCreatedBefore'] = $dateCreatedBefore; } /** * Read only the rooms with this status. Can be: `in-progress` (default) or `completed` * * @param string $status Read only the rooms with this status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Read only rooms with the this `unique_name`. * * @param string $uniqueName Read only rooms with this unique_name * @return $this Fluent Builder */ public function setUniqueName(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 . ']'; } } Video/V1/RecordingSettingsList.php 0000644 00000001665 15107452353 0013117 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\ListResource; use Twilio\Version; class RecordingSettingsList extends ListResource { /** * Construct the RecordingSettingsList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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]'; } } Video/V1/RecordingOptions.php 0000644 00000013745 15107452353 0012120 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Options; use Twilio\Values; abstract class RecordingOptions { /** * @param string $status Read only the recordings that have this status * @param string $sourceSid Read only the recordings that have this source_sid * @param string[] $groupingSid Read only recordings that have this grouping_sid * @param \DateTime $dateCreatedAfter Read only recordings that started on or * after this [ISO * 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone * @param \DateTime $dateCreatedBefore Read only recordings that started before * this [ISO * 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone * @param string $mediaType Read only recordings that have this media type * @return ReadRecordingOptions Options builder */ public static function read(string $status = Values::NONE, string $sourceSid = Values::NONE, array $groupingSid = Values::ARRAY_NONE, \DateTime $dateCreatedAfter = Values::NONE, \DateTime $dateCreatedBefore = Values::NONE, string $mediaType = Values::NONE): ReadRecordingOptions { return new ReadRecordingOptions($status, $sourceSid, $groupingSid, $dateCreatedAfter, $dateCreatedBefore, $mediaType); } } class ReadRecordingOptions extends Options { /** * @param string $status Read only the recordings that have this status * @param string $sourceSid Read only the recordings that have this source_sid * @param string[] $groupingSid Read only recordings that have this grouping_sid * @param \DateTime $dateCreatedAfter Read only recordings that started on or * after this [ISO * 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone * @param \DateTime $dateCreatedBefore Read only recordings that started before * this [ISO * 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone * @param string $mediaType Read only recordings that have this media type */ public function __construct(string $status = Values::NONE, string $sourceSid = Values::NONE, array $groupingSid = Values::ARRAY_NONE, \DateTime $dateCreatedAfter = Values::NONE, \DateTime $dateCreatedBefore = Values::NONE, string $mediaType = Values::NONE) { $this->options['status'] = $status; $this->options['sourceSid'] = $sourceSid; $this->options['groupingSid'] = $groupingSid; $this->options['dateCreatedAfter'] = $dateCreatedAfter; $this->options['dateCreatedBefore'] = $dateCreatedBefore; $this->options['mediaType'] = $mediaType; } /** * Read only the recordings that have this status. Can be: `processing`, `completed`, or `deleted`. * * @param string $status Read only the recordings that have this status * @return $this Fluent Builder */ public function setStatus(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 that have this grouping_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 * @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 * @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 . ']'; } } Video/V1/CompositionPage.php 0000644 00000002216 15107452353 0011717 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CompositionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Video/V1/CompositionInstance.php 0000644 00000011770 15107452353 0012614 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $status * @property \DateTime $dateCreated * @property \DateTime $dateCompleted * @property \DateTime $dateDeleted * @property string $sid * @property string $roomSid * @property string[] $audioSources * @property string[] $audioSourcesExcluded * @property array $videoLayout * @property string $resolution * @property bool $trim * @property string $format * @property int $bitrate * @property string $size * @property int $duration * @property string $mediaExternalLocation * @property string $statusCallback * @property string $statusCallbackMethod * @property string $url * @property array $links */ class CompositionInstance extends InstanceResource { /** * Initialize the CompositionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the CompositionInstance * * @return CompositionInstance Fetched CompositionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CompositionInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Video/V1/RecordingContext.php 0000644 00000003376 15107452353 0012110 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class RecordingContext extends InstanceContext { /** * Initialize the RecordingContext * * @param Version $version Version that contains the resource * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Recordings/' . \rawurlencode($sid) . ''; } /** * Fetch the RecordingInstance * * @return RecordingInstance Fetched RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RecordingInstance { $payload = $this->version->fetch('GET', $this->uri); return new RecordingInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the RecordingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Video/V1/RecordingInstance.php 0000644 00000011124 15107452353 0012216 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $status * @property \DateTime $dateCreated * @property string $sid * @property string $sourceSid * @property string $size * @property string $url * @property string $type * @property int $duration * @property string $containerFormat * @property string $codec * @property array $groupingSids * @property string $trackName * @property string $offset * @property string $mediaExternalLocation * @property string $statusCallback * @property string $statusCallbackMethod * @property array $links */ class RecordingInstance extends InstanceResource { /** * Initialize the RecordingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the RecordingInstance * * @return RecordingInstance Fetched RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RecordingInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Video/V1/Room/ParticipantList.php 0000644 00000012612 15107452353 0012646 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ParticipantList extends ListResource { /** * Construct the ParticipantList * * @param Version $version Version that contains the resource * @param string $roomSid The SID of the participant's room */ public function __construct(Version $version, string $roomSid) { parent::__construct($version); // Path Solution $this->solution = ['roomSid' => $roomSid, ]; $this->uri = '/Rooms/' . \rawurlencode($roomSid) . '/Participants'; } /** * Streams ParticipantInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of ParticipantInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 that identifies the 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]'; } } Video/V1/Room/RoomRecordingOptions.php 0000644 00000010311 15107452353 0013653 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room; use Twilio\Options; use Twilio\Values; abstract class RoomRecordingOptions { /** * @param string $status Read only the recordings with this status * @param string $sourceSid Read only the recordings that have this source_sid * @param \DateTime $dateCreatedAfter Read only Recordings that started on or * after this ISO 8601 datetime with time * zone * @param \DateTime $dateCreatedBefore Read only Recordings that started before * this ISO 8601 date-time with time zone * @return ReadRoomRecordingOptions Options builder */ public static function read(string $status = Values::NONE, string $sourceSid = Values::NONE, \DateTime $dateCreatedAfter = Values::NONE, \DateTime $dateCreatedBefore = Values::NONE): ReadRoomRecordingOptions { return new ReadRoomRecordingOptions($status, $sourceSid, $dateCreatedAfter, $dateCreatedBefore); } } class ReadRoomRecordingOptions extends Options { /** * @param string $status Read only the recordings with this status * @param string $sourceSid Read only the recordings that have this source_sid * @param \DateTime $dateCreatedAfter Read only Recordings that started on or * after this ISO 8601 datetime with time * zone * @param \DateTime $dateCreatedBefore Read only Recordings that started before * this ISO 8601 date-time with time zone */ public function __construct(string $status = Values::NONE, string $sourceSid = Values::NONE, \DateTime $dateCreatedAfter = Values::NONE, \DateTime $dateCreatedBefore = Values::NONE) { $this->options['status'] = $status; $this->options['sourceSid'] = $sourceSid; $this->options['dateCreatedAfter'] = $dateCreatedAfter; $this->options['dateCreatedBefore'] = $dateCreatedBefore; } /** * Read only the recordings with this status. Can be: `processing`, `completed`, or `deleted`. * * @param string $status Read only the recordings with this status * @return $this Fluent Builder */ public function setStatus(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 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 date-time 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 . ']'; } } Video/V1/Room/ParticipantInstance.php 0000644 00000012541 15107452353 0013500 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Video\V1\Room\Participant\AnonymizeList; use Twilio\Rest\Video\V1\Room\Participant\PublishedTrackList; use Twilio\Rest\Video\V1\Room\Participant\SubscribeRulesList; use Twilio\Rest\Video\V1\Room\Participant\SubscribedTrackList; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $roomSid * @property string $accountSid * @property string $status * @property string $identity * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property \DateTime $startTime * @property \DateTime $endTime * @property int $duration * @property string $url * @property array $links */ class ParticipantInstance extends InstanceResource { protected $_publishedTracks; protected $_subscribedTracks; protected $_subscribeRules; protected $_anonymize; /** * Initialize the ParticipantInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $roomSid The SID of the participant's room * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, array $payload, string $roomSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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 publishedTracks */ protected function getPublishedTracks(): PublishedTrackList { return $this->proxy()->publishedTracks; } /** * Access the subscribedTracks */ protected function getSubscribedTracks(): SubscribedTrackList { return $this->proxy()->subscribedTracks; } /** * Access the subscribeRules */ protected function getSubscribeRules(): SubscribeRulesList { return $this->proxy()->subscribeRules; } /** * 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) . ']'; } } Video/V1/Room/Participant/AnonymizeContext.php 0000644 00000003363 15107452353 0015333 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class AnonymizeContext extends InstanceContext { /** * Initialize the AnonymizeContext * * @param Version $version Version that contains the resource * @param string $roomSid The SID of the room with the participant to update * @param string $sid The SID that identifies the resource to update */ public function __construct(Version $version, $roomSid, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->update('POST', $this->uri); 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) . ']'; } } Video/V1/Room/Participant/AnonymizeInstance.php 0000644 00000007527 15107452353 0015461 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $roomSid * @property string $accountSid * @property string $status * @property string $identity * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property \DateTime $startTime * @property \DateTime $endTime * @property int $duration * @property string $url */ class AnonymizeInstance extends InstanceResource { /** * Initialize the AnonymizeInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $roomSid The SID of the participant's room * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $roomSid, string $sid) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Video/V1/Room/Participant/PublishedTrackContext.php 0000644 00000004157 15107452353 0016270 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class PublishedTrackContext extends InstanceContext { /** * Initialize the PublishedTrackContext * * @param Version $version Version that contains the resource * @param string $roomSid The SID of the Room resource where the Track resource * to fetch is published * @param string $participantSid The SID of the Participant resource with the * published track to fetch * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, $roomSid, $participantSid, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Video/V1/Room/Participant/SubscribedTrackList.php 0000644 00000012263 15107452353 0015722 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class SubscribedTrackList extends ListResource { /** * Construct the SubscribedTrackList * * @param Version $version Version that contains the resource * @param string $roomSid The SID of the room where the track is published * @param string $participantSid The SID of the participant that subscribes to * the track */ public function __construct(Version $version, string $roomSid, string $participantSid) { parent::__construct($version); // Path Solution $this->solution = ['roomSid' => $roomSid, 'participantSid' => $participantSid, ]; $this->uri = '/Rooms/' . \rawurlencode($roomSid) . '/Participants/' . \rawurlencode($participantSid) . '/SubscribedTracks'; } /** * Streams SubscribedTrackInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 that identifies the 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]'; } } Video/V1/Room/Participant/PublishedTrackInstance.php 0000644 00000010007 15107452353 0016377 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $participantSid * @property string $roomSid * @property string $name * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property bool $enabled * @property string $kind * @property string $url */ class PublishedTrackInstance extends InstanceResource { /** * Initialize the PublishedTrackInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $roomSid The SID of the Room resource where the track is * published * @param string $participantSid The SID of the Participant resource with the * published track * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, array $payload, string $roomSid, string $participantSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Video/V1/Room/Participant/SubscribeRulesPage.php 0000644 00000002473 15107452353 0015547 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SubscribeRulesPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Video/V1/Room/Participant/AnonymizePage.php 0000644 00000002422 15107452353 0014556 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AnonymizePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Video/V1/Room/Participant/PublishedTrackList.php 0000644 00000012313 15107452353 0015550 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class PublishedTrackList extends ListResource { /** * Construct the PublishedTrackList * * @param Version $version Version that contains the resource * @param string $roomSid The SID of the Room resource where the track is * published * @param string $participantSid The SID of the Participant resource with the * published track */ public function __construct(Version $version, string $roomSid, string $participantSid) { parent::__construct($version); // Path Solution $this->solution = ['roomSid' => $roomSid, 'participantSid' => $participantSid, ]; $this->uri = '/Rooms/' . \rawurlencode($roomSid) . '/Participants/' . \rawurlencode($participantSid) . '/PublishedTracks'; } /** * Streams PublishedTrackInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 that identifies the 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]'; } } Video/V1/Room/Participant/SubscribeRulesOptions.php 0000644 00000003041 15107452353 0016316 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\Options; use Twilio\Values; abstract class SubscribeRulesOptions { /** * @param array $rules A JSON-encoded array of subscribe rules * @return UpdateSubscribeRulesOptions Options builder */ public static function update(array $rules = Values::ARRAY_NONE): UpdateSubscribeRulesOptions { return new UpdateSubscribeRulesOptions($rules); } } class UpdateSubscribeRulesOptions extends Options { /** * @param array $rules A JSON-encoded array of subscribe rules */ public function __construct(array $rules = Values::ARRAY_NONE) { $this->options['rules'] = $rules; } /** * A JSON-encoded array of subscribe rules. See the [Specifying Subscribe Rules](https://www.twilio.com/docs/video/api/track-subscriptions#specifying-sr) section for further information. * * @param array $rules A JSON-encoded array of subscribe rules * @return $this Fluent Builder */ public function setRules(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 . ']'; } } Video/V1/Room/Participant/SubscribeRulesList.php 0000644 00000004754 15107452353 0015612 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class SubscribeRulesList extends ListResource { /** * Construct the SubscribeRulesList * * @param Version $version Version that contains the resource * @param string $roomSid The SID of the Room resource for the Subscribe Rules * @param string $participantSid The SID of the Participant resource for the * Subscribe Rules */ public function __construct(Version $version, string $roomSid, string $participantSid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SubscribeRulesInstance( $this->version, $payload, $this->solution['roomSid'], $this->solution['participantSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.SubscribeRulesList]'; } } Video/V1/Room/Participant/SubscribedTrackPage.php 0000644 00000002501 15107452353 0015655 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SubscribedTrackPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Video/V1/Room/Participant/PublishedTrackPage.php 0000644 00000002473 15107452353 0015517 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class PublishedTrackPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Video/V1/Room/Participant/SubscribedTrackInstance.php 0000644 00000010124 15107452353 0016545 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $participantSid * @property string $publisherSid * @property string $roomSid * @property string $name * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property bool $enabled * @property string $kind * @property string $url */ class SubscribedTrackInstance extends InstanceResource { /** * Initialize the SubscribedTrackInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $roomSid The SID of the room where the track is published * @param string $participantSid The SID of the participant that subscribes to * the track * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, array $payload, string $roomSid, string $participantSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Video/V1/Room/Participant/AnonymizeList.php 0000644 00000002227 15107452353 0014620 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\ListResource; use Twilio\Version; class AnonymizeList extends ListResource { /** * Construct the AnonymizeList * * @param Version $version Version that contains the resource * @param string $roomSid The SID of the participant's room * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, string $roomSid, string $sid) { parent::__construct($version); // Path Solution $this->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]'; } } Video/V1/Room/Participant/SubscribeRulesInstance.php 0000644 00000004640 15107452353 0016435 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $participantSid * @property string $roomSid * @property string[] $rules * @property \DateTime $dateCreated * @property \DateTime $dateUpdated */ class SubscribeRulesInstance extends InstanceResource { /** * Initialize the SubscribeRulesInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $roomSid The SID of the Room resource for the Subscribe Rules * @param string $participantSid The SID of the Participant resource for the * Subscribe Rules */ public function __construct(Version $version, array $payload, string $roomSid, string $participantSid) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Video/V1/Room/Participant/SubscribedTrackContext.php 0000644 00000004164 15107452353 0016434 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class SubscribedTrackContext extends InstanceContext { /** * Initialize the SubscribedTrackContext * * @param Version $version Version that contains the resource * @param string $roomSid The SID of the Room where the Track resource to fetch * is subscribed * @param string $participantSid The SID of the participant that subscribes to * the Track resource to fetch * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, $roomSid, $participantSid, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Video/V1/Room/RecordingRulesList.php 0000644 00000004057 15107452354 0013324 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class RecordingRulesList extends ListResource { /** * Construct the RecordingRulesList * * @param Version $version Version that contains the resource * @param string $roomSid The SID of the Room resource for the Recording Rules */ public function __construct(Version $version, string $roomSid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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]'; } } Video/V1/Room/ParticipantContext.php 0000644 00000013704 15107452354 0013363 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Video\V1\Room\Participant\AnonymizeList; use Twilio\Rest\Video\V1\Room\Participant\PublishedTrackList; use Twilio\Rest\Video\V1\Room\Participant\SubscribeRulesList; use Twilio\Rest\Video\V1\Room\Participant\SubscribedTrackList; use Twilio\Values; use Twilio\Version; /** * @property PublishedTrackList $publishedTracks * @property SubscribedTrackList $subscribedTracks * @property SubscribeRulesList $subscribeRules * @property AnonymizeList $anonymize * @method \Twilio\Rest\Video\V1\Room\Participant\PublishedTrackContext publishedTracks(string $sid) * @method \Twilio\Rest\Video\V1\Room\Participant\SubscribedTrackContext subscribedTracks(string $sid) * @method \Twilio\Rest\Video\V1\Room\Participant\AnonymizeContext anonymize() */ class ParticipantContext extends InstanceContext { protected $_publishedTracks; protected $_subscribedTracks; protected $_subscribeRules; protected $_anonymize; /** * Initialize the ParticipantContext * * @param Version $version Version that contains the resource * @param string $roomSid The SID of the room with the Participant resource to * fetch * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, $roomSid, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ParticipantInstance( $this->version, $payload, $this->solution['roomSid'], $this->solution['sid'] ); } /** * 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 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 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 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) . ']'; } } Video/V1/Room/ParticipantOptions.php 0000644 00000013064 15107452354 0013371 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room; use Twilio\Options; use Twilio\Values; abstract class ParticipantOptions { /** * @param string $status Read only the participants with this status * @param string $identity Read only the Participants with this user identity * value * @param \DateTime $dateCreatedAfter Read only Participants that started after * this date in UTC ISO 8601 format * @param \DateTime $dateCreatedBefore Read only Participants that started * before this date in ISO 8601 format * @return ReadParticipantOptions Options builder */ public static function read(string $status = Values::NONE, string $identity = Values::NONE, \DateTime $dateCreatedAfter = Values::NONE, \DateTime $dateCreatedBefore = Values::NONE): ReadParticipantOptions { return new ReadParticipantOptions($status, $identity, $dateCreatedAfter, $dateCreatedBefore); } /** * @param string $status The new status of the resource * @return UpdateParticipantOptions Options builder */ public static function update(string $status = Values::NONE): UpdateParticipantOptions { return new UpdateParticipantOptions($status); } } class ReadParticipantOptions extends Options { /** * @param string $status Read only the participants with this status * @param string $identity Read only the Participants with this user identity * value * @param \DateTime $dateCreatedAfter Read only Participants that started after * this date in UTC ISO 8601 format * @param \DateTime $dateCreatedBefore Read only Participants that started * before this date in ISO 8601 format */ public function __construct(string $status = Values::NONE, string $identity = Values::NONE, \DateTime $dateCreatedAfter = Values::NONE, \DateTime $dateCreatedBefore = Values::NONE) { $this->options['status'] = $status; $this->options['identity'] = $identity; $this->options['dateCreatedAfter'] = $dateCreatedAfter; $this->options['dateCreatedBefore'] = $dateCreatedBefore; } /** * Read only the participants with this status. Can be: `connected` or `disconnected`. For `in-progress` Rooms the default Status is `connected`, for `completed` Rooms only `disconnected` Participants are returned. * * @param string $status Read only the participants with this status * @return $this Fluent Builder */ public function setStatus(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 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 UTC ISO 8601 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 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 The new status of the resource */ public function __construct(string $status = Values::NONE) { $this->options['status'] = $status; } /** * The new status of the resource. Can be: `connected` or `disconnected`. For `in-progress` Rooms the default Status is `connected`, for `completed` Rooms only `disconnected` Participants are returned. * * @param string $status The new status of the resource * @return $this Fluent Builder */ public function setStatus(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 . ']'; } } Video/V1/Room/RecordingRulesPage.php 0000644 00000002306 15107452354 0013260 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RecordingRulesPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Video/V1/Room/RoomRecordingList.php 0000644 00000012752 15107452354 0013147 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class RoomRecordingList extends ListResource { /** * Construct the RoomRecordingList * * @param Version $version Version that contains the resource * @param string $roomSid The SID of the Room resource the recording is * associated with */ public function __construct(Version $version, string $roomSid) { parent::__construct($version); // Path Solution $this->solution = ['roomSid' => $roomSid, ]; $this->uri = '/Rooms/' . \rawurlencode($roomSid) . '/Recordings'; } /** * Streams RoomRecordingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of RoomRecordingInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 that identifies the resource to fetch */ 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]'; } } Video/V1/Room/RoomRecordingInstance.php 0000644 00000011351 15107452354 0013772 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $status * @property \DateTime $dateCreated * @property string $sid * @property string $sourceSid * @property string $size * @property string $url * @property string $type * @property int $duration * @property string $containerFormat * @property string $codec * @property array $groupingSids * @property string $trackName * @property string $offset * @property string $mediaExternalLocation * @property string $roomSid * @property array $links */ class RoomRecordingInstance extends InstanceResource { /** * Initialize the RoomRecordingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $roomSid The SID of the Room resource the recording is * associated with * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, array $payload, string $roomSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the RoomRecordingInstance * * @return RoomRecordingInstance Fetched RoomRecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RoomRecordingInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Video/V1/Room/ParticipantPage.php 0000644 00000002264 15107452354 0012612 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ParticipantPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Video/V1/Room/RoomRecordingContext.php 0000644 00000004071 15107452354 0013653 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class RoomRecordingContext extends InstanceContext { /** * Initialize the RoomRecordingContext * * @param Version $version Version that contains the resource * @param string $roomSid The SID of the Room resource with the recording to * fetch * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, $roomSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['roomSid' => $roomSid, 'sid' => $sid, ]; $this->uri = '/Rooms/' . \rawurlencode($roomSid) . '/Recordings/' . \rawurlencode($sid) . ''; } /** * Fetch the RoomRecordingInstance * * @return RoomRecordingInstance Fetched RoomRecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RoomRecordingInstance { $payload = $this->version->fetch('GET', $this->uri); return new RoomRecordingInstance( $this->version, $payload, $this->solution['roomSid'], $this->solution['sid'] ); } /** * Delete the RoomRecordingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Video/V1/Room/RoomRecordingPage.php 0000644 00000002300 15107452354 0013074 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RoomRecordingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Video/V1/Room/RecordingRulesOptions.php 0000644 00000002606 15107452354 0014042 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room; use Twilio\Options; use Twilio\Values; abstract class RecordingRulesOptions { /** * @param array $rules A JSON-encoded array of recording rules * @return UpdateRecordingRulesOptions Options builder */ public static function update(array $rules = Values::ARRAY_NONE): UpdateRecordingRulesOptions { return new UpdateRecordingRulesOptions($rules); } } class UpdateRecordingRulesOptions extends Options { /** * @param array $rules A JSON-encoded array of recording rules */ public function __construct(array $rules = Values::ARRAY_NONE) { $this->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 . ']'; } } Video/V1/Room/RecordingRulesInstance.php 0000644 00000004135 15107452354 0014152 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $roomSid * @property string[] $rules * @property \DateTime $dateCreated * @property \DateTime $dateUpdated */ class RecordingRulesInstance extends InstanceResource { /** * Initialize the RecordingRulesInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $roomSid The SID of the Room resource for the Recording Rules */ public function __construct(Version $version, array $payload, string $roomSid) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Video/V1/RoomPage.php 0000644 00000002144 15107452354 0010331 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RoomPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Video/V1/RoomInstance.php 0000644 00000014207 15107452354 0011224 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Rest\Video\V1\Room\ParticipantList; use Twilio\Rest\Video\V1\Room\RecordingRulesList; use Twilio\Rest\Video\V1\Room\RoomRecordingList; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $status * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $accountSid * @property bool $enableTurn * @property string $uniqueName * @property string $statusCallback * @property string $statusCallbackMethod * @property \DateTime $endTime * @property int $duration * @property string $type * @property int $maxParticipants * @property int $maxParticipantDuration * @property int $maxConcurrentPublishedTracks * @property bool $recordParticipantsOnConnect * @property string[] $videoCodecs * @property string $mediaRegion * @property bool $audioOnly * @property int $emptyRoomTimeout * @property int $unusedRoomTimeout * @property bool $largeRoom * @property string $url * @property array $links */ class RoomInstance extends InstanceResource { protected $_recordings; protected $_participants; protected $_recordingRules; /** * Initialize the RoomInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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 The new status of the resource * @return RoomInstance Updated RoomInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status): RoomInstance { return $this->proxy()->update($status); } /** * Access the recordings */ protected function getRecordings(): RoomRecordingList { return $this->proxy()->recordings; } /** * Access the participants */ protected function getParticipants(): ParticipantList { return $this->proxy()->participants; } /** * Access the recordingRules */ protected function getRecordingRules(): RecordingRulesList { return $this->proxy()->recordingRules; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Video/V1/CompositionSettingsContext.php 0000644 00000005127 15107452354 0014215 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class CompositionSettingsContext extends InstanceContext { /** * Initialize the CompositionSettingsContext * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/CompositionSettings/Default'; } /** * Fetch the CompositionSettingsInstance * * @return CompositionSettingsInstance Fetched CompositionSettingsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CompositionSettingsInstance { $payload = $this->version->fetch('GET', $this->uri); return new CompositionSettingsInstance($this->version, $payload); } /** * Create the CompositionSettingsInstance * * @param string $friendlyName A descriptive string that you create to describe * the resource * @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']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); 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) . ']'; } } Video/V1/CompositionHookContext.php 0000644 00000006325 15107452354 0013316 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class CompositionHookContext extends InstanceContext { /** * Initialize the CompositionHookContext * * @param Version $version Version that contains the resource * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/CompositionHooks/' . \rawurlencode($sid) . ''; } /** * Fetch the CompositionHookInstance * * @return CompositionHookInstance Fetched CompositionHookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CompositionHookInstance { $payload = $this->version->fetch('GET', $this->uri); return new CompositionHookInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the CompositionHookInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the CompositionHookInstance * * @param string $friendlyName A unique string to describe the resource * @param array|Options $options Optional Arguments * @return CompositionHookInstance Updated CompositionHookInstance * @throws TwilioException When an HTTP error occurs. */ public function update(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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } Video/V1/CompositionHookList.php 0000644 00000015321 15107452354 0012601 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class CompositionHookList extends ListResource { /** * Construct the CompositionHookList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/CompositionHooks'; } /** * Streams CompositionHookInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of CompositionHookInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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); } /** * Create the CompositionHookInstance * * @param string $friendlyName A unique string to describe the resource * @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']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CompositionHookInstance($this->version, $payload); } /** * Constructs a CompositionHookContext * * @param string $sid The SID that identifies the resource to fetch */ 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]'; } } Video/V1/RecordingSettingsContext.php 0000644 00000004774 15107452354 0013635 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class RecordingSettingsContext extends InstanceContext { /** * Initialize the RecordingSettingsContext * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/RecordingSettings/Default'; } /** * Fetch the RecordingSettingsInstance * * @return RecordingSettingsInstance Fetched RecordingSettingsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RecordingSettingsInstance { $payload = $this->version->fetch('GET', $this->uri); return new RecordingSettingsInstance($this->version, $payload); } /** * Create the RecordingSettingsInstance * * @param string $friendlyName A string to describe the resource * @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']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); 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) . ']'; } } Video/V1/RecordingPage.php 0000644 00000002202 15107452354 0011324 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RecordingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Video/V1/RecordingSettingsInstance.php 0000644 00000007473 15107452354 0013754 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $friendlyName * @property string $awsCredentialsSid * @property string $awsS3Url * @property bool $awsStorageEnabled * @property string $encryptionKeySid * @property bool $encryptionEnabled * @property string $url */ class RecordingSettingsInstance extends InstanceResource { /** * Initialize the RecordingSettingsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the RecordingSettingsInstance * * @return RecordingSettingsInstance Fetched RecordingSettingsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RecordingSettingsInstance { return $this->proxy()->fetch(); } /** * Create the RecordingSettingsInstance * * @param string $friendlyName A string to describe the resource * @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); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Video/V1/CompositionHookPage.php 0000644 00000002246 15107452354 0012544 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CompositionHookPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Video/V1/CompositionSettingsPage.php 0000644 00000002276 15107452354 0013447 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CompositionSettingsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Video/V1/CompositionContext.php 0000644 00000003422 15107452354 0012470 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class CompositionContext extends InstanceContext { /** * Initialize the CompositionContext * * @param Version $version Version that contains the resource * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Compositions/' . \rawurlencode($sid) . ''; } /** * Fetch the CompositionInstance * * @return CompositionInstance Fetched CompositionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CompositionInstance { $payload = $this->version->fetch('GET', $this->uri); return new CompositionInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the CompositionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Video/V1/CompositionHookOptions.php 0000644 00000063616 15107452354 0013333 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Options; use Twilio\Values; abstract class CompositionHookOptions { /** * @param bool $enabled Read only CompositionHook resources with an enabled * value that matches this parameter * @param \DateTime $dateCreatedAfter Read only CompositionHook resources * created on or after this ISO 8601 * datetime with time zone * @param \DateTime $dateCreatedBefore Read only CompositionHook resources * created before this ISO 8601 datetime * with time zone * @param string $friendlyName Read only CompositionHook resources with * friendly names that match this string * @return ReadCompositionHookOptions Options builder */ public static function read(bool $enabled = Values::NONE, \DateTime $dateCreatedAfter = Values::NONE, \DateTime $dateCreatedBefore = Values::NONE, string $friendlyName = Values::NONE): ReadCompositionHookOptions { return new ReadCompositionHookOptions($enabled, $dateCreatedAfter, $dateCreatedBefore, $friendlyName); } /** * @param bool $enabled Whether the composition hook is active * @param array $videoLayout An object that describes the video layout of the * composition hook * @param string[] $audioSources An array of track names from the same group * room to merge * @param string[] $audioSourcesExcluded An array of track names to exclude * @param string $resolution A string that describes the rows (width) and * columns (height) of the generated composed video * in pixels * @param string $format The container format of the media files used by the * compositions created by the composition hook * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @param bool $trim Whether to clip the intervals where there is no active * media in the Compositions triggered by the composition hook * @return CreateCompositionHookOptions Options builder */ public static function create(bool $enabled = Values::NONE, array $videoLayout = Values::ARRAY_NONE, array $audioSources = Values::ARRAY_NONE, array $audioSourcesExcluded = Values::ARRAY_NONE, string $resolution = Values::NONE, string $format = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, bool $trim = Values::NONE): CreateCompositionHookOptions { return new CreateCompositionHookOptions($enabled, $videoLayout, $audioSources, $audioSourcesExcluded, $resolution, $format, $statusCallback, $statusCallbackMethod, $trim); } /** * @param bool $enabled Whether the composition hook is active * @param array $videoLayout A JSON object that describes the video layout of * the composition hook * @param string[] $audioSources An array of track names from the same group * room to merge * @param string[] $audioSourcesExcluded An array of track names to exclude * @param bool $trim Whether to clip the intervals where there is no active * media in the Compositions triggered by the composition hook * @param string $format The container format of the media files used by the * compositions created by the composition hook * @param string $resolution A string that describes the columns (width) and * rows (height) of the generated composed video in * pixels * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @return UpdateCompositionHookOptions Options builder */ public static function update(bool $enabled = Values::NONE, array $videoLayout = Values::ARRAY_NONE, array $audioSources = Values::ARRAY_NONE, array $audioSourcesExcluded = Values::ARRAY_NONE, bool $trim = Values::NONE, string $format = Values::NONE, string $resolution = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE): UpdateCompositionHookOptions { return new UpdateCompositionHookOptions($enabled, $videoLayout, $audioSources, $audioSourcesExcluded, $trim, $format, $resolution, $statusCallback, $statusCallbackMethod); } } class ReadCompositionHookOptions extends Options { /** * @param bool $enabled Read only CompositionHook resources with an enabled * value that matches this parameter * @param \DateTime $dateCreatedAfter Read only CompositionHook resources * created on or after this ISO 8601 * datetime with time zone * @param \DateTime $dateCreatedBefore Read only CompositionHook resources * created before this ISO 8601 datetime * with time zone * @param string $friendlyName Read only CompositionHook resources with * friendly names that match this string */ public function __construct(bool $enabled = Values::NONE, \DateTime $dateCreatedAfter = Values::NONE, \DateTime $dateCreatedBefore = Values::NONE, 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 * 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 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 * @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 CreateCompositionHookOptions extends Options { /** * @param bool $enabled Whether the composition hook is active * @param array $videoLayout An object that describes the video layout of the * composition hook * @param string[] $audioSources An array of track names from the same group * room to merge * @param string[] $audioSourcesExcluded An array of track names to exclude * @param string $resolution A string that describes the rows (width) and * columns (height) of the generated composed video * in pixels * @param string $format The container format of the media files used by the * compositions created by the composition hook * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @param bool $trim Whether to clip the intervals where there is no active * media in the Compositions triggered by the composition hook */ public function __construct(bool $enabled = Values::NONE, array $videoLayout = Values::ARRAY_NONE, array $audioSources = Values::ARRAY_NONE, array $audioSourcesExcluded = Values::ARRAY_NONE, string $resolution = Values::NONE, string $format = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, bool $trim = Values::NONE) { $this->options['enabled'] = $enabled; $this->options['videoLayout'] = $videoLayout; $this->options['audioSources'] = $audioSources; $this->options['audioSourcesExcluded'] = $audioSourcesExcluded; $this->options['resolution'] = $resolution; $this->options['format'] = $format; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['trim'] = $trim; } /** * Whether the composition hook is active. When `true`, the composition hook will be triggered for every completed Group Room in the account. When `false`, the composition hook will never be triggered. * * @param bool $enabled Whether the composition hook is active * @return $this Fluent Builder */ public function setEnabled(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 * @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 * @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 * @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 rows (width) and * columns (height) of the generated composed video * in pixels * @return $this Fluent Builder */ public function setResolution(string $resolution): self { $this->options['resolution'] = $resolution; return $this; } /** * The container format of the media files used by the compositions created by the composition hook. Can be: `mp4` or `webm` and the default is `webm`. If `mp4` or `webm`, `audio_sources` must have one or more tracks and/or a `video_layout` element must contain a valid `video_sources` list, otherwise an error occurs. * * @param string $format The container format of the media files used by the * compositions created by the composition hook * @return $this Fluent Builder */ public function setFormat(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 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 * @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 * @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 UpdateCompositionHookOptions extends Options { /** * @param bool $enabled Whether the composition hook is active * @param array $videoLayout A JSON object that describes the video layout of * the composition hook * @param string[] $audioSources An array of track names from the same group * room to merge * @param string[] $audioSourcesExcluded An array of track names to exclude * @param bool $trim Whether to clip the intervals where there is no active * media in the Compositions triggered by the composition hook * @param string $format The container format of the media files used by the * compositions created by the composition hook * @param string $resolution A string that describes the columns (width) and * rows (height) of the generated composed video in * pixels * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback */ public function __construct(bool $enabled = Values::NONE, array $videoLayout = Values::ARRAY_NONE, array $audioSources = Values::ARRAY_NONE, array $audioSourcesExcluded = Values::ARRAY_NONE, bool $trim = Values::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 * @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 * @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 * @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 * @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 * @return $this Fluent Builder */ public function setTrim(bool $trim): self { $this->options['trim'] = $trim; return $this; } /** * The container format of the media files used by the compositions created by the composition hook. Can be: `mp4` or `webm` and the default is `webm`. If `mp4` or `webm`, `audio_sources` must have one or more tracks and/or a `video_layout` element must contain a valid `video_sources` list, otherwise an error occurs. * * @param string $format The container format of the media files used by the * compositions created by the composition hook * @return $this Fluent Builder */ public function setFormat(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 * @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 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 * @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 . ']'; } } Video/V1/CompositionSettingsList.php 0000644 00000001701 15107452354 0013476 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\ListResource; use Twilio\Version; class CompositionSettingsList extends ListResource { /** * Construct the CompositionSettingsList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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]'; } } Video/V1/CompositionList.php 0000644 00000015056 15107452354 0011765 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class CompositionList extends ListResource { /** * Construct the CompositionList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Compositions'; } /** * Streams CompositionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of CompositionInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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); } /** * 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']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CompositionInstance($this->version, $payload); } /** * Constructs a CompositionContext * * @param string $sid The SID that identifies the resource to fetch */ 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]'; } } Video/V1/RecordingSettingsPage.php 0000644 00000002262 15107452354 0013053 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RecordingSettingsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Video/V1/CompositionOptions.php 0000644 00000033723 15107452354 0012506 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Options; use Twilio\Values; abstract class CompositionOptions { /** * @param string $status Read only Composition resources with this status * @param \DateTime $dateCreatedAfter Read only Composition resources created * on or after this [ISO * 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone * @param \DateTime $dateCreatedBefore Read only Composition resources created * before this ISO 8601 date-time with time * zone * @param string $roomSid Read only Composition resources with this Room SID * @return ReadCompositionOptions Options builder */ public static function read(string $status = Values::NONE, \DateTime $dateCreatedAfter = Values::NONE, \DateTime $dateCreatedBefore = Values::NONE, string $roomSid = Values::NONE): ReadCompositionOptions { return new ReadCompositionOptions($status, $dateCreatedAfter, $dateCreatedBefore, $roomSid); } /** * @param array $videoLayout An object that describes the video layout of the * composition * @param string[] $audioSources An array of track names from the same group * room to merge * @param string[] $audioSourcesExcluded An array of track names to exclude * @param string $resolution A string that describes the columns (width) and * rows (height) of the generated composed video in * pixels * @param string $format The container format of the composition's media files * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @param bool $trim Whether to clip the intervals where there is no active * media in the composition * @return CreateCompositionOptions Options builder */ public static function create(array $videoLayout = Values::ARRAY_NONE, array $audioSources = Values::ARRAY_NONE, array $audioSourcesExcluded = Values::ARRAY_NONE, string $resolution = Values::NONE, string $format = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, bool $trim = Values::NONE): CreateCompositionOptions { return new CreateCompositionOptions($videoLayout, $audioSources, $audioSourcesExcluded, $resolution, $format, $statusCallback, $statusCallbackMethod, $trim); } } class ReadCompositionOptions extends Options { /** * @param string $status Read only Composition resources with this status * @param \DateTime $dateCreatedAfter Read only Composition resources created * on or after this [ISO * 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone * @param \DateTime $dateCreatedBefore Read only Composition resources created * before this ISO 8601 date-time with time * zone * @param string $roomSid Read only Composition resources with this Room SID */ public function __construct(string $status = Values::NONE, \DateTime $dateCreatedAfter = Values::NONE, \DateTime $dateCreatedBefore = Values::NONE, 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 * @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 . ']'; } } class CreateCompositionOptions extends Options { /** * @param array $videoLayout An object that describes the video layout of the * composition * @param string[] $audioSources An array of track names from the same group * room to merge * @param string[] $audioSourcesExcluded An array of track names to exclude * @param string $resolution A string that describes the columns (width) and * rows (height) of the generated composed video in * pixels * @param string $format The container format of the composition's media files * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @param bool $trim Whether to clip the intervals where there is no active * media in the composition */ public function __construct(array $videoLayout = Values::ARRAY_NONE, array $audioSources = Values::ARRAY_NONE, array $audioSourcesExcluded = Values::ARRAY_NONE, string $resolution = Values::NONE, string $format = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, bool $trim = Values::NONE) { $this->options['videoLayout'] = $videoLayout; $this->options['audioSources'] = $audioSources; $this->options['audioSourcesExcluded'] = $audioSourcesExcluded; $this->options['resolution'] = $resolution; $this->options['format'] = $format; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['trim'] = $trim; } /** * An object that describes the video layout of the composition in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. 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 * @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 * @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 * @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 * @return $this Fluent Builder */ public function setResolution(string $resolution): self { $this->options['resolution'] = $resolution; return $this; } /** * The container format of the composition's media files. Can be: `mp4` or `webm` and the default is `webm`. If you specify `mp4` or `webm`, you must also specify one or more `audio_sources` and/or a `video_layout` element that contains a valid `video_sources` list, otherwise an error occurs. * * @param string $format The container format of the composition's media files * @return $this Fluent Builder */ public function setFormat(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 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 * @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 * @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 . ']'; } } Video/V1/CompositionHookInstance.php 0000644 00000011700 15107452354 0013427 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $friendlyName * @property bool $enabled * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $sid * @property string[] $audioSources * @property string[] $audioSourcesExcluded * @property array $videoLayout * @property string $resolution * @property bool $trim * @property string $format * @property string $statusCallback * @property string $statusCallbackMethod * @property string $url */ class CompositionHookInstance extends InstanceResource { /** * Initialize the CompositionHookInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID that identifies the resource to fetch */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the CompositionHookInstance * * @return CompositionHookInstance Fetched CompositionHookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CompositionHookInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Update the CompositionHookInstance * * @param string $friendlyName A unique string to describe the resource * @param array|Options $options Optional Arguments * @return CompositionHookInstance Updated CompositionHookInstance * @throws TwilioException When an HTTP error occurs. */ public function update(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) . ']'; } } Video/V1.php 0000644 00000010146 15107452354 0006621 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Video\V1\CompositionHookList; use Twilio\Rest\Video\V1\CompositionList; use Twilio\Rest\Video\V1\CompositionSettingsList; use Twilio\Rest\Video\V1\RecordingList; use Twilio\Rest\Video\V1\RecordingSettingsList; use Twilio\Rest\Video\V1\RoomList; use Twilio\Version; /** * @property CompositionList $compositions * @property CompositionHookList $compositionHooks * @property CompositionSettingsList $compositionSettings * @property RecordingList $recordings * @property RecordingSettingsList $recordingSettings * @property RoomList $rooms * @method \Twilio\Rest\Video\V1\CompositionContext compositions(string $sid) * @method \Twilio\Rest\Video\V1\CompositionHookContext compositionHooks(string $sid) * @method \Twilio\Rest\Video\V1\RecordingContext recordings(string $sid) * @method \Twilio\Rest\Video\V1\RoomContext rooms(string $sid) */ class V1 extends Version { protected $_compositions; protected $_compositionHooks; protected $_compositionSettings; protected $_recordings; protected $_recordingSettings; protected $_rooms; /** * Construct the V1 version of Video * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->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]'; } } Video.php 0000644 00000011563 15107452354 0006337 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Video\V1; /** * @property \Twilio\Rest\Video\V1 $v1 * @property \Twilio\Rest\Video\V1\CompositionList $compositions * @property \Twilio\Rest\Video\V1\CompositionHookList $compositionHooks * @property \Twilio\Rest\Video\V1\CompositionSettingsList $compositionSettings * @property \Twilio\Rest\Video\V1\RecordingList $recordings * @property \Twilio\Rest\Video\V1\RecordingSettingsList $recordingSettings * @property \Twilio\Rest\Video\V1\RoomList $rooms * @method \Twilio\Rest\Video\V1\CompositionContext compositions(string $sid) * @method \Twilio\Rest\Video\V1\CompositionHookContext compositionHooks(string $sid) * @method \Twilio\Rest\Video\V1\CompositionSettingsContext compositionSettings() * @method \Twilio\Rest\Video\V1\RecordingContext recordings(string $sid) * @method \Twilio\Rest\Video\V1\RecordingSettingsContext recordingSettings() * @method \Twilio\Rest\Video\V1\RoomContext rooms(string $sid) */ class Video extends Domain { protected $_v1; /** * Construct the Video Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->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); } protected function getCompositions(): \Twilio\Rest\Video\V1\CompositionList { return $this->v1->compositions; } /** * @param string $sid The SID that identifies the resource to fetch */ protected function contextCompositions(string $sid): \Twilio\Rest\Video\V1\CompositionContext { return $this->v1->compositions($sid); } protected function getCompositionHooks(): \Twilio\Rest\Video\V1\CompositionHookList { return $this->v1->compositionHooks; } /** * @param string $sid The SID that identifies the resource to fetch */ protected function contextCompositionHooks(string $sid): \Twilio\Rest\Video\V1\CompositionHookContext { return $this->v1->compositionHooks($sid); } protected function getCompositionSettings(): \Twilio\Rest\Video\V1\CompositionSettingsList { return $this->v1->compositionSettings; } protected function contextCompositionSettings(): \Twilio\Rest\Video\V1\CompositionSettingsContext { return $this->v1->compositionSettings(); } protected function getRecordings(): \Twilio\Rest\Video\V1\RecordingList { return $this->v1->recordings; } /** * @param string $sid The SID that identifies the resource to fetch */ protected function contextRecordings(string $sid): \Twilio\Rest\Video\V1\RecordingContext { return $this->v1->recordings($sid); } protected function getRecordingSettings(): \Twilio\Rest\Video\V1\RecordingSettingsList { return $this->v1->recordingSettings; } protected function contextRecordingSettings(): \Twilio\Rest\Video\V1\RecordingSettingsContext { return $this->v1->recordingSettings(); } protected function getRooms(): \Twilio\Rest\Video\V1\RoomList { return $this->v1->rooms; } /** * @param string $sid The SID that identifies the resource to fetch */ protected function contextRooms(string $sid): \Twilio\Rest\Video\V1\RoomContext { return $this->v1->rooms($sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video]'; } } Trusthub.php 0000644 00000013600 15107452354 0007103 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Trusthub\V1; /** * @property \Twilio\Rest\Trusthub\V1 $v1 * @property \Twilio\Rest\Trusthub\V1\CustomerProfilesList $customerProfiles * @property \Twilio\Rest\Trusthub\V1\EndUserList $endUsers * @property \Twilio\Rest\Trusthub\V1\EndUserTypeList $endUserTypes * @property \Twilio\Rest\Trusthub\V1\PoliciesList $policies * @property \Twilio\Rest\Trusthub\V1\SupportingDocumentList $supportingDocuments * @property \Twilio\Rest\Trusthub\V1\SupportingDocumentTypeList $supportingDocumentTypes * @property \Twilio\Rest\Trusthub\V1\TrustProductsList $trustProducts * @method \Twilio\Rest\Trusthub\V1\CustomerProfilesContext customerProfiles(string $sid) * @method \Twilio\Rest\Trusthub\V1\EndUserContext endUsers(string $sid) * @method \Twilio\Rest\Trusthub\V1\EndUserTypeContext endUserTypes(string $sid) * @method \Twilio\Rest\Trusthub\V1\PoliciesContext policies(string $sid) * @method \Twilio\Rest\Trusthub\V1\SupportingDocumentContext supportingDocuments(string $sid) * @method \Twilio\Rest\Trusthub\V1\SupportingDocumentTypeContext supportingDocumentTypes(string $sid) * @method \Twilio\Rest\Trusthub\V1\TrustProductsContext trustProducts(string $sid) */ class Trusthub extends Domain { protected $_v1; /** * Construct the Trusthub Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->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); } protected function getCustomerProfiles(): \Twilio\Rest\Trusthub\V1\CustomerProfilesList { return $this->v1->customerProfiles; } /** * @param string $sid The unique string that identifies the resource. */ protected function contextCustomerProfiles(string $sid): \Twilio\Rest\Trusthub\V1\CustomerProfilesContext { return $this->v1->customerProfiles($sid); } protected function getEndUsers(): \Twilio\Rest\Trusthub\V1\EndUserList { return $this->v1->endUsers; } /** * @param string $sid The unique string that identifies the resource */ protected function contextEndUsers(string $sid): \Twilio\Rest\Trusthub\V1\EndUserContext { return $this->v1->endUsers($sid); } protected function getEndUserTypes(): \Twilio\Rest\Trusthub\V1\EndUserTypeList { return $this->v1->endUserTypes; } /** * @param string $sid The unique string that identifies the End-User Type * resource */ protected function contextEndUserTypes(string $sid): \Twilio\Rest\Trusthub\V1\EndUserTypeContext { return $this->v1->endUserTypes($sid); } protected function getPolicies(): \Twilio\Rest\Trusthub\V1\PoliciesList { return $this->v1->policies; } /** * @param string $sid The unique string that identifies the Policy resource */ protected function contextPolicies(string $sid): \Twilio\Rest\Trusthub\V1\PoliciesContext { return $this->v1->policies($sid); } protected function getSupportingDocuments(): \Twilio\Rest\Trusthub\V1\SupportingDocumentList { return $this->v1->supportingDocuments; } /** * @param string $sid The unique string that identifies the resource */ protected function contextSupportingDocuments(string $sid): \Twilio\Rest\Trusthub\V1\SupportingDocumentContext { return $this->v1->supportingDocuments($sid); } protected function getSupportingDocumentTypes(): \Twilio\Rest\Trusthub\V1\SupportingDocumentTypeList { return $this->v1->supportingDocumentTypes; } /** * @param string $sid The unique string that identifies the Supporting Document * Type resource */ protected function contextSupportingDocumentTypes(string $sid): \Twilio\Rest\Trusthub\V1\SupportingDocumentTypeContext { return $this->v1->supportingDocumentTypes($sid); } protected function getTrustProducts(): \Twilio\Rest\Trusthub\V1\TrustProductsList { return $this->v1->trustProducts; } /** * @param string $sid The unique string that identifies the resource. */ protected function contextTrustProducts(string $sid): \Twilio\Rest\Trusthub\V1\TrustProductsContext { return $this->v1->trustProducts($sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub]'; } } Proxy.php 0000644 00000004735 15107452354 0006415 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Proxy\V1; /** * @property \Twilio\Rest\Proxy\V1 $v1 * @property \Twilio\Rest\Proxy\V1\ServiceList $services * @method \Twilio\Rest\Proxy\V1\ServiceContext services(string $sid) */ class Proxy extends Domain { protected $_v1; /** * Construct the Proxy Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->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); } protected function getServices(): \Twilio\Rest\Proxy\V1\ServiceList { return $this->v1->services; } /** * @param string $sid The unique string that identifies the resource */ protected function contextServices(string $sid): \Twilio\Rest\Proxy\V1\ServiceContext { return $this->v1->services($sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Proxy]'; } } Microvisor.php 0000644 00000007743 15107452354 0007432 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Microvisor\V1; /** * @property \Twilio\Rest\Microvisor\V1 $v1 * @property \Twilio\Rest\Microvisor\V1\AccountConfigList $accountConfigs * @property \Twilio\Rest\Microvisor\V1\AccountSecretList $accountSecrets * @property \Twilio\Rest\Microvisor\V1\AppList $apps * @property \Twilio\Rest\Microvisor\V1\DeviceList $devices * @method \Twilio\Rest\Microvisor\V1\AccountConfigContext accountConfigs(string $key) * @method \Twilio\Rest\Microvisor\V1\AccountSecretContext accountSecrets(string $key) * @method \Twilio\Rest\Microvisor\V1\AppContext apps(string $sid) * @method \Twilio\Rest\Microvisor\V1\DeviceContext devices(string $sid) */ class Microvisor extends Domain { protected $_v1; /** * Construct the Microvisor Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->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); } protected function getAccountConfigs(): \Twilio\Rest\Microvisor\V1\AccountConfigList { return $this->v1->accountConfigs; } /** * @param string $key The config key. */ protected function contextAccountConfigs(string $key): \Twilio\Rest\Microvisor\V1\AccountConfigContext { return $this->v1->accountConfigs($key); } protected function getAccountSecrets(): \Twilio\Rest\Microvisor\V1\AccountSecretList { return $this->v1->accountSecrets; } /** * @param string $key The secret key. */ protected function contextAccountSecrets(string $key): \Twilio\Rest\Microvisor\V1\AccountSecretContext { return $this->v1->accountSecrets($key); } protected function getApps(): \Twilio\Rest\Microvisor\V1\AppList { return $this->v1->apps; } /** * @param string $sid A string that uniquely identifies this App. */ protected function contextApps(string $sid): \Twilio\Rest\Microvisor\V1\AppContext { return $this->v1->apps($sid); } protected function getDevices(): \Twilio\Rest\Microvisor\V1\DeviceList { return $this->v1->devices; } /** * @param string $sid A string that uniquely identifies this Device. */ protected function contextDevices(string $sid): \Twilio\Rest\Microvisor\V1\DeviceContext { return $this->v1->devices($sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Microvisor]'; } } Serverless.php 0000644 00000005016 15107452354 0007422 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Serverless\V1; /** * @property \Twilio\Rest\Serverless\V1 $v1 * @property \Twilio\Rest\Serverless\V1\ServiceList $services * @method \Twilio\Rest\Serverless\V1\ServiceContext services(string $sid) */ class Serverless extends Domain { protected $_v1; /** * Construct the Serverless Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->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); } protected function getServices(): \Twilio\Rest\Serverless\V1\ServiceList { return $this->v1->services; } /** * @param string $sid The SID of the Service resource to fetch */ protected function contextServices(string $sid): \Twilio\Rest\Serverless\V1\ServiceContext { return $this->v1->services($sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless]'; } } Microvisor/V1/AccountSecretInstance.php 0000644 00000007221 15107452354 0014136 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Microvisor\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $key * @property \DateTime $dateRotated * @property string $url */ class AccountSecretInstance extends InstanceResource { /** * Initialize the AccountSecretInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $key The secret key. */ public function __construct(Version $version, array $payload, string $key = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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. * @return AccountSecretInstance Updated AccountSecretInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $value): AccountSecretInstance { return $this->proxy()->update($value); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Microvisor/V1/AccountConfigList.php 0000644 00000012605 15107452354 0013267 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Microvisor\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AccountConfigList extends ListResource { /** * Construct the AccountConfigList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Configs'; } /** * 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']); } /** * 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); } /** * 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); } /** * Create the AccountConfigInstance * * @param string $key The config key. * @param string $value The config value. * @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, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AccountConfigInstance($this->version, $payload); } /** * Constructs a AccountConfigContext * * @param string $key The config key. */ 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]'; } } Microvisor/V1/AccountSecretContext.php 0000644 00000004745 15107452354 0014026 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Microvisor\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AccountSecretContext extends InstanceContext { /** * Initialize the AccountSecretContext * * @param Version $version Version that contains the resource * @param string $key The secret key. */ public function __construct(Version $version, $key) { parent::__construct($version); // Path Solution $this->solution = ['key' => $key, ]; $this->uri = '/Secrets/' . \rawurlencode($key) . ''; } /** * Fetch the AccountSecretInstance * * @return AccountSecretInstance Fetched AccountSecretInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AccountSecretInstance { $payload = $this->version->fetch('GET', $this->uri); return new AccountSecretInstance($this->version, $payload, $this->solution['key']); } /** * Update the AccountSecretInstance * * @param string $value The secret value. * @return AccountSecretInstance Updated AccountSecretInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $value): AccountSecretInstance { $data = Values::of(['Value' => $value, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new AccountSecretInstance($this->version, $payload, $this->solution['key']); } /** * Delete the AccountSecretInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Microvisor/V1/AppList.php 0000644 00000011174 15107452354 0011265 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Microvisor\V1; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AppList extends ListResource { /** * Construct the AppList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Apps'; } /** * 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']); } /** * 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); } /** * 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 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]'; } } Microvisor/V1/Device/DeviceSecretList.php 0000644 00000013135 15107452354 0014310 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Microvisor\V1\Device; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DeviceSecretList extends ListResource { /** * Construct the DeviceSecretList * * @param Version $version Version that contains the resource * @param string $deviceSid A string that uniquely identifies the parent Device. */ public function __construct(Version $version, string $deviceSid) { parent::__construct($version); // Path Solution $this->solution = ['deviceSid' => $deviceSid, ]; $this->uri = '/Devices/' . \rawurlencode($deviceSid) . '/Secrets'; } /** * 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']); } /** * 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); } /** * 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); } /** * Create the DeviceSecretInstance * * @param string $key The secret key. * @param string $value The secret value. * @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, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new DeviceSecretInstance($this->version, $payload, $this->solution['deviceSid']); } /** * Constructs a DeviceSecretContext * * @param string $key The secret key. */ 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]'; } } Microvisor/V1/Device/DeviceSecretPage.php 0000644 00000002632 15107452354 0014251 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Microvisor\V1\Device; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DeviceSecretPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Microvisor/V1/Device/DeviceConfigInstance.php 0000644 00000010044 15107452355 0015116 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Microvisor\V1\Device; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $deviceSid * @property string $key * @property string $value * @property \DateTime $dateUpdated * @property string $url */ class DeviceConfigInstance extends InstanceResource { /** * Initialize the DeviceConfigInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $deviceSid A string that uniquely identifies the parent Device. * @param string $key The config key. */ public function __construct(Version $version, array $payload, string $deviceSid, string $key = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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. * @return DeviceConfigInstance Updated DeviceConfigInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $value): DeviceConfigInstance { return $this->proxy()->update($value); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Microvisor/V1/Device/DeviceSecretContext.php 0000644 00000005455 15107452355 0015030 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Microvisor\V1\Device; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DeviceSecretContext extends InstanceContext { /** * Initialize the DeviceSecretContext * * @param Version $version Version that contains the resource * @param string $deviceSid A string that uniquely identifies the Device. * @param string $key The secret key. */ public function __construct(Version $version, $deviceSid, $key) { parent::__construct($version); // Path Solution $this->solution = ['deviceSid' => $deviceSid, 'key' => $key, ]; $this->uri = '/Devices/' . \rawurlencode($deviceSid) . '/Secrets/' . \rawurlencode($key) . ''; } /** * Fetch the DeviceSecretInstance * * @return DeviceSecretInstance Fetched DeviceSecretInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DeviceSecretInstance { $payload = $this->version->fetch('GET', $this->uri); return new DeviceSecretInstance( $this->version, $payload, $this->solution['deviceSid'], $this->solution['key'] ); } /** * Update the DeviceSecretInstance * * @param string $value The secret value. * @return DeviceSecretInstance Updated DeviceSecretInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $value): DeviceSecretInstance { $data = Values::of(['Value' => $value, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new DeviceSecretInstance( $this->version, $payload, $this->solution['deviceSid'], $this->solution['key'] ); } /** * Delete the DeviceSecretInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Microvisor/V1/Device/DeviceConfigList.php 0000644 00000013135 15107452355 0014271 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Microvisor\V1\Device; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DeviceConfigList extends ListResource { /** * Construct the DeviceConfigList * * @param Version $version Version that contains the resource * @param string $deviceSid A string that uniquely identifies the parent Device. */ public function __construct(Version $version, string $deviceSid) { parent::__construct($version); // Path Solution $this->solution = ['deviceSid' => $deviceSid, ]; $this->uri = '/Devices/' . \rawurlencode($deviceSid) . '/Configs'; } /** * 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']); } /** * 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); } /** * 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); } /** * Create the DeviceConfigInstance * * @param string $key The config key. * @param string $value The config value. * @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, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new DeviceConfigInstance($this->version, $payload, $this->solution['deviceSid']); } /** * Constructs a DeviceConfigContext * * @param string $key The config key. */ 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]'; } } Microvisor/V1/Device/DeviceConfigContext.php 0000644 00000005455 15107452355 0015010 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Microvisor\V1\Device; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DeviceConfigContext extends InstanceContext { /** * Initialize the DeviceConfigContext * * @param Version $version Version that contains the resource * @param string $deviceSid A string that uniquely identifies the Device. * @param string $key The config key. */ public function __construct(Version $version, $deviceSid, $key) { parent::__construct($version); // Path Solution $this->solution = ['deviceSid' => $deviceSid, 'key' => $key, ]; $this->uri = '/Devices/' . \rawurlencode($deviceSid) . '/Configs/' . \rawurlencode($key) . ''; } /** * Fetch the DeviceConfigInstance * * @return DeviceConfigInstance Fetched DeviceConfigInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DeviceConfigInstance { $payload = $this->version->fetch('GET', $this->uri); return new DeviceConfigInstance( $this->version, $payload, $this->solution['deviceSid'], $this->solution['key'] ); } /** * Update the DeviceConfigInstance * * @param string $value The config value. * @return DeviceConfigInstance Updated DeviceConfigInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $value): DeviceConfigInstance { $data = Values::of(['Value' => $value, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new DeviceConfigInstance( $this->version, $payload, $this->solution['deviceSid'], $this->solution['key'] ); } /** * Delete the DeviceConfigInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Microvisor/V1/Device/DeviceConfigPage.php 0000644 00000002632 15107452355 0014232 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Microvisor\V1\Device; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DeviceConfigPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Microvisor/V1/Device/DeviceSecretInstance.php 0000644 00000007714 15107452355 0015150 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Microvisor\V1\Device; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $deviceSid * @property string $key * @property \DateTime $dateRotated * @property string $url */ class DeviceSecretInstance extends InstanceResource { /** * Initialize the DeviceSecretInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $deviceSid A string that uniquely identifies the parent Device. * @param string $key The secret key. */ public function __construct(Version $version, array $payload, string $deviceSid, string $key = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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. * @return DeviceSecretInstance Updated DeviceSecretInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $value): DeviceSecretInstance { return $this->proxy()->update($value); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Microvisor/V1/AppInstance.php 0000644 00000007174 15107452355 0012124 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Microvisor\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $accountSid * @property string $hash * @property string $uniqueName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class AppInstance extends InstanceResource { /** * Initialize the AppInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid A string that uniquely identifies this App. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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'), ]; $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; } /** * Fetch the AppInstance * * @return AppInstance Fetched AppInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AppInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Microvisor/V1/DeviceList.php 0000644 00000011273 15107452355 0011745 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Microvisor\V1; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DeviceList extends ListResource { /** * Construct the DeviceList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Devices'; } /** * 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']); } /** * 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); } /** * 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 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]'; } } Microvisor/V1/AccountSecretList.php 0000644 00000012605 15107452355 0013310 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Microvisor\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AccountSecretList extends ListResource { /** * Construct the AccountSecretList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Secrets'; } /** * 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']); } /** * 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); } /** * 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); } /** * Create the AccountSecretInstance * * @param string $key The secret key. * @param string $value The secret value. * @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, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AccountSecretInstance($this->version, $payload); } /** * Constructs a AccountSecretContext * * @param string $key The secret key. */ 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]'; } } Microvisor/V1/DeviceInstance.php 0000644 00000010657 15107452355 0012603 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Microvisor\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Microvisor\V1\Device\DeviceConfigList; use Twilio\Rest\Microvisor\V1\Device\DeviceSecretList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $uniqueName * @property string $accountSid * @property array $app * @property array $logging * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class DeviceInstance extends InstanceResource { protected $_deviceConfigs; protected $_deviceSecrets; /** * Initialize the DeviceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid A string that uniquely identifies this Device. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Microvisor/V1/AccountConfigInstance.php 0000644 00000007351 15107452355 0014123 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Microvisor\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $key * @property \DateTime $dateUpdated * @property string $value * @property string $url */ class AccountConfigInstance extends InstanceResource { /** * Initialize the AccountConfigInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $key The config key. */ public function __construct(Version $version, array $payload, string $key = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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. * @return AccountConfigInstance Updated AccountConfigInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $value): AccountConfigInstance { return $this->proxy()->update($value); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Microvisor/V1/AccountConfigPage.php 0000644 00000002564 15107452355 0013234 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Microvisor\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AccountConfigPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Microvisor/V1/DeviceContext.php 0000644 00000011076 15107452355 0012457 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Microvisor\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Microvisor\V1\Device\DeviceConfigList; use Twilio\Rest\Microvisor\V1\Device\DeviceSecretList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property DeviceConfigList $deviceConfigs * @property DeviceSecretList $deviceSecrets * @method \Twilio\Rest\Microvisor\V1\Device\DeviceConfigContext deviceConfigs(string $key) * @method \Twilio\Rest\Microvisor\V1\Device\DeviceSecretContext deviceSecrets(string $key) */ class DeviceContext extends InstanceContext { protected $_deviceConfigs; protected $_deviceSecrets; /** * Initialize the DeviceContext * * @param Version $version Version that contains the resource * @param string $sid A string that uniquely identifies this Device. */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } Microvisor/V1/AccountSecretPage.php 0000644 00000002564 15107452355 0013254 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Microvisor\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AccountSecretPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Microvisor/V1/DeviceOptions.php 0000644 00000005705 15107452355 0012470 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Microvisor\V1; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class DeviceOptions { /** * @param string $uniqueName A unique, developer-assigned name for this Device. * @param string $targetApp The target App SID or unique name. * @param bool $loggingEnabled Whether to enable logging. * @return UpdateDeviceOptions Options builder */ public static function update(string $uniqueName = Values::NONE, string $targetApp = Values::NONE, bool $loggingEnabled = Values::NONE): UpdateDeviceOptions { return new UpdateDeviceOptions($uniqueName, $targetApp, $loggingEnabled); } } class UpdateDeviceOptions extends Options { /** * @param string $uniqueName A unique, developer-assigned name for this Device. * @param string $targetApp The target App SID or unique name. * @param bool $loggingEnabled Whether to enable logging. */ public function __construct(string $uniqueName = Values::NONE, string $targetApp = Values::NONE, bool $loggingEnabled = Values::NONE) { $this->options['uniqueName'] = $uniqueName; $this->options['targetApp'] = $targetApp; $this->options['loggingEnabled'] = $loggingEnabled; } /** * 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, developer-assigned name for this Device. * @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 target App SID or unique name. * @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 Whether to enable logging. * @return $this Fluent Builder */ public function setLoggingEnabled(bool $loggingEnabled): self { $this->options['loggingEnabled'] = $loggingEnabled; return $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 . ']'; } } Microvisor/V1/AppPage.php 0000644 00000002470 15107452355 0011226 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Microvisor\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AppPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Microvisor/V1/AccountConfigContext.php 0000644 00000004745 15107452355 0014007 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Microvisor\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AccountConfigContext extends InstanceContext { /** * Initialize the AccountConfigContext * * @param Version $version Version that contains the resource * @param string $key The config key. */ public function __construct(Version $version, $key) { parent::__construct($version); // Path Solution $this->solution = ['key' => $key, ]; $this->uri = '/Configs/' . \rawurlencode($key) . ''; } /** * Fetch the AccountConfigInstance * * @return AccountConfigInstance Fetched AccountConfigInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AccountConfigInstance { $payload = $this->version->fetch('GET', $this->uri); return new AccountConfigInstance($this->version, $payload, $this->solution['key']); } /** * Update the AccountConfigInstance * * @param string $value The config value. * @return AccountConfigInstance Updated AccountConfigInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $value): AccountConfigInstance { $data = Values::of(['Value' => $value, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new AccountConfigInstance($this->version, $payload, $this->solution['key']); } /** * Delete the AccountConfigInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Microvisor/V1/AppContext.php 0000644 00000003625 15107452355 0012001 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Microvisor\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AppContext extends InstanceContext { /** * Initialize the AppContext * * @param Version $version Version that contains the resource * @param string $sid A string that uniquely identifies this App. */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Apps/' . \rawurlencode($sid) . ''; } /** * Fetch the AppInstance * * @return AppInstance Fetched AppInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AppInstance { $payload = $this->version->fetch('GET', $this->uri); return new AppInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the AppInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Microvisor/V1/DevicePage.php 0000644 00000002512 15107452355 0011702 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Microvisor\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DevicePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Microvisor/V1.php 0000644 00000006533 15107452355 0007715 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Microvisor; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Microvisor\V1\AccountConfigList; use Twilio\Rest\Microvisor\V1\AccountSecretList; use Twilio\Rest\Microvisor\V1\AppList; use Twilio\Rest\Microvisor\V1\DeviceList; use Twilio\Version; /** * @property AccountConfigList $accountConfigs * @property AccountSecretList $accountSecrets * @property AppList $apps * @property DeviceList $devices * @method \Twilio\Rest\Microvisor\V1\AccountConfigContext accountConfigs(string $key) * @method \Twilio\Rest\Microvisor\V1\AccountSecretContext accountSecrets(string $key) * @method \Twilio\Rest\Microvisor\V1\AppContext apps(string $sid) * @method \Twilio\Rest\Microvisor\V1\DeviceContext devices(string $sid) */ class V1 extends Version { protected $_accountConfigs; protected $_accountSecrets; protected $_apps; protected $_devices; /** * Construct the V1 version of Microvisor * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->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]'; } } Numbers/V2/RegulatoryCompliance/EndUserInstance.php 0000644 00000007725 15107452355 0016363 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $friendlyName * @property string $type * @property array $attributes * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class EndUserInstance extends InstanceResource { /** * Initialize the EndUserInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Numbers/V2/RegulatoryCompliance/RegulationOptions.php 0000644 00000005377 15107452355 0017017 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance; use Twilio\Options; use Twilio\Values; abstract class RegulationOptions { /** * @param string $endUserType The type of End User of the Regulation resource * @param string $isoCountry The ISO country code of the phone number's country * @param string $numberType The type of phone number being regulated * @return ReadRegulationOptions Options builder */ public static function read(string $endUserType = Values::NONE, string $isoCountry = Values::NONE, string $numberType = Values::NONE): ReadRegulationOptions { return new ReadRegulationOptions($endUserType, $isoCountry, $numberType); } } class ReadRegulationOptions extends Options { /** * @param string $endUserType The type of End User of the Regulation resource * @param string $isoCountry The ISO country code of the phone number's country * @param string $numberType The type of phone number being regulated */ public function __construct(string $endUserType = Values::NONE, string $isoCountry = Values::NONE, string $numberType = Values::NONE) { $this->options['endUserType'] = $endUserType; $this->options['isoCountry'] = $isoCountry; $this->options['numberType'] = $numberType; } /** * The type of End User the regulation requires - can be `individual` or `business`. * * @param string $endUserType The type of End User of the Regulation resource * @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 being regulated * @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.ReadRegulationOptions ' . $options . ']'; } } Numbers/V2/RegulatoryCompliance/RegulationPage.php 0000644 00000002270 15107452355 0016225 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RegulationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Numbers/V2/RegulatoryCompliance/BundleOptions.php 0000644 00000046631 15107452355 0016115 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance; use Twilio\Options; use Twilio\Values; abstract class BundleOptions { /** * @param string $statusCallback The URL we call to inform your application of * status changes. * @param string $regulationSid The unique string of a regulation. * @param string $isoCountry The ISO country code of the country * @param string $endUserType The type of End User of the Bundle resource * @param string $numberType The type of phone number * @return CreateBundleOptions Options builder */ public static function create(string $statusCallback = Values::NONE, string $regulationSid = Values::NONE, string $isoCountry = Values::NONE, string $endUserType = Values::NONE, string $numberType = Values::NONE): CreateBundleOptions { return new CreateBundleOptions($statusCallback, $regulationSid, $isoCountry, $endUserType, $numberType); } /** * @param string $status The verification status of the Bundle resource * @param string $friendlyName The string that you assigned to describe the * resource * @param string $regulationSid The unique string of a regulation. * @param string $isoCountry The ISO country code of the country * @param string $numberType The type of phone number * @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. * @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. * @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. * @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::NONE, string $sortBy = Values::NONE, string $sortDirection = Values::NONE, string $validUntilDateBefore = Values::NONE, string $validUntilDate = Values::NONE, string $validUntilDateAfter = Values::NONE): ReadBundleOptions { return new ReadBundleOptions($status, $friendlyName, $regulationSid, $isoCountry, $numberType, $hasValidUntilDate, $sortBy, $sortDirection, $validUntilDateBefore, $validUntilDate, $validUntilDateAfter); } /** * @param string $status The verification status of the Bundle resource * @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 * @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. * @param string $isoCountry The ISO country code of the country * @param string $endUserType The type of End User of the Bundle resource * @param string $numberType The type of phone number */ 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. * @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 of the country * @return $this Fluent Builder */ public function setIsoCountry(string $isoCountry): self { $this->options['isoCountry'] = $isoCountry; return $this; } /** * The [type of End User](https://www.twilio.com/docs/phone-numbers/regulatory/api/end-user-types) of the Bundle resource. * * @param string $endUserType The type of End User of the Bundle resource * @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 * @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 * @param string $friendlyName The string that you assigned to describe the * resource * @param string $regulationSid The unique string of a regulation. * @param string $isoCountry The ISO country code of the country * @param string $numberType The type of phone number * @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. * @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. * @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. */ 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::NONE, string $sortBy = Values::NONE, string $sortDirection = Values::NONE, string $validUntilDateBefore = Values::NONE, string $validUntilDate = Values::NONE, string $validUntilDateAfter = Values::NONE) { $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 * @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 * @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. * @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 ISO country code of the country * @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 * @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. * @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. * @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. * @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 The verification status of the Bundle resource * @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 */ 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; } /** * The verification status of the Bundle resource. * * @param string $status The verification status of the Bundle resource * @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 * @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 . ']'; } } Numbers/V2/RegulatoryCompliance/SupportingDocumentTypeContext.php 0000644 00000003272 15107452355 0021402 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class SupportingDocumentTypeContext extends InstanceContext { /** * Initialize the SupportingDocumentTypeContext * * @param Version $version Version that contains the resource * @param string $sid The unique string that identifies the Supporting Document * Type resource */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Numbers/V2/RegulatoryCompliance/SupportingDocumentTypePage.php 0000644 00000002400 15107452355 0020622 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SupportingDocumentTypePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Numbers/V2/RegulatoryCompliance/Bundle/ReplaceItemsList.php 0000644 00000003421 15107452355 0017740 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance\Bundle; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ReplaceItemsList extends ListResource { /** * Construct the ReplaceItemsList * * @param Version $version Version that contains the resource * @param string $bundleSid The unique string that identifies the resource. */ public function __construct(Version $version, string $bundleSid) { parent::__construct($version); // Path Solution $this->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, ]); $payload = $this->version->create('POST', $this->uri, [], $data); 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]'; } } Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentInstance.php 0000644 00000007334 15107452355 0021152 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance\Bundle; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $bundleSid * @property string $accountSid * @property string $objectSid * @property \DateTime $dateCreated * @property string $url */ class ItemAssignmentInstance extends InstanceResource { /** * Initialize the ItemAssignmentInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $bundleSid The unique string that identifies the Bundle * resource. * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $bundleSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the ItemAssignmentInstance * * @return ItemAssignmentInstance Fetched ItemAssignmentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ItemAssignmentInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Numbers/V2/RegulatoryCompliance/Bundle/ReplaceItemsInstance.php 0000644 00000005552 15107452355 0020600 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance\Bundle; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $regulationSid * @property string $friendlyName * @property string $status * @property \DateTime $validUntil * @property string $email * @property string $statusCallback * @property \DateTime $dateCreated * @property \DateTime $dateUpdated */ class ReplaceItemsInstance extends InstanceResource { /** * Initialize the ReplaceItemsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $bundleSid The unique string that identifies the resource. */ public function __construct(Version $version, array $payload, string $bundleSid) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentList.php 0000644 00000013000 15107452355 0020304 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance\Bundle; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ItemAssignmentList extends ListResource { /** * Construct the ItemAssignmentList * * @param Version $version Version that contains the resource * @param string $bundleSid The unique string that identifies the Bundle * resource. */ public function __construct(Version $version, string $bundleSid) { parent::__construct($version); // Path Solution $this->solution = ['bundleSid' => $bundleSid, ]; $this->uri = '/RegulatoryCompliance/Bundles/' . \rawurlencode($bundleSid) . '/ItemAssignments'; } /** * Create the ItemAssignmentInstance * * @param string $objectSid The sid of an object bag * @return ItemAssignmentInstance Created ItemAssignmentInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $objectSid): ItemAssignmentInstance { $data = Values::of(['ObjectSid' => $objectSid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ItemAssignmentInstance($this->version, $payload, $this->solution['bundleSid']); } /** * 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']); } /** * 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); } /** * 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 identifies the 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]'; } }Numbers/V2/RegulatoryCompliance/Bundle/ReplaceItemsPage.php 0000644 00000002541 15107452355 0017703 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance\Bundle; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ReplaceItemsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Numbers/V2/RegulatoryCompliance/Bundle/EvaluationInstance.php 0000644 00000007115 15107452355 0020327 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance\Bundle; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $regulationSid * @property string $bundleSid * @property string $status * @property array[] $results * @property \DateTime $dateCreated * @property string $url */ class EvaluationInstance extends InstanceResource { /** * Initialize the EvaluationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $bundleSid The unique string that identifies the resource * @param string $sid The unique string that identifies the Evaluation resource */ public function __construct(Version $version, array $payload, string $bundleSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyPage.php 0000644 00000002525 15107452355 0017374 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance\Bundle; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class BundleCopyPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentPage.php 0000644 00000002374 15107452355 0020261 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance\Bundle; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ItemAssignmentPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Numbers/V2/RegulatoryCompliance/Bundle/EvaluationPage.php 0000644 00000002344 15107452356 0017437 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance\Bundle; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class EvaluationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyInstance.php 0000644 00000005544 15107452356 0020271 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance\Bundle; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $regulationSid * @property string $friendlyName * @property string $status * @property \DateTime $validUntil * @property string $email * @property string $statusCallback * @property \DateTime $dateCreated * @property \DateTime $dateUpdated */ class BundleCopyInstance extends InstanceResource { /** * Initialize the BundleCopyInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $bundleSid The unique string that identifies the resource. */ public function __construct(Version $version, array $payload, string $bundleSid) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyOptions.php 0000644 00000003375 15107452356 0020160 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance\Bundle; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ abstract class BundleCopyOptions { /** * @param string $friendlyName The string that you assigned to describe the * copied bundle * @return CreateBundleCopyOptions Options builder */ public static function create(string $friendlyName = Values::NONE): CreateBundleCopyOptions { return new CreateBundleCopyOptions($friendlyName); } } class CreateBundleCopyOptions extends Options { /** * @param string $friendlyName The string that you assigned to describe the * copied bundle */ public function __construct(string $friendlyName = Values::NONE) { $this->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 . ']'; } } Numbers/V2/RegulatoryCompliance/Bundle/EvaluationList.php 0000644 00000012356 15107452356 0017502 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance\Bundle; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class EvaluationList extends ListResource { /** * Construct the EvaluationList * * @param Version $version Version that contains the resource * @param string $bundleSid The unique string that identifies the resource */ public function __construct(Version $version, string $bundleSid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->create('POST', $this->uri); return new EvaluationInstance($this->version, $payload, $this->solution['bundleSid']); } /** * 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']); } /** * 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); } /** * 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]'; } } Numbers/V2/RegulatoryCompliance/Bundle/EvaluationContext.php 0000644 00000003445 15107452356 0020212 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance\Bundle; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class EvaluationContext extends InstanceContext { /** * Initialize the EvaluationContext * * @param Version $version Version that contains the resource * @param string $bundleSid The unique string that identifies the resource * @param string $sid The unique string that identifies the Evaluation resource */ public function __construct(Version $version, $bundleSid, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyList.php 0000644 00000012411 15107452356 0017427 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance\Bundle; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class BundleCopyList extends ListResource { /** * Construct the BundleCopyList * * @param Version $version Version that contains the resource * @param string $bundleSid The unique string that identifies the resource. */ public function __construct(Version $version, string $bundleSid) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new BundleCopyInstance($this->version, $payload, $this->solution['bundleSid']); } /** * 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']); } /** * 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); } /** * 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]'; } } Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentContext.php 0000644 00000004137 15107452356 0021031 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance\Bundle; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class ItemAssignmentContext extends InstanceContext { /** * Initialize the ItemAssignmentContext * * @param Version $version Version that contains the resource * @param string $bundleSid The unique string that identifies the resource. * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $bundleSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['bundleSid' => $bundleSid, 'sid' => $sid, ]; $this->uri = '/RegulatoryCompliance/Bundles/' . \rawurlencode($bundleSid) . '/ItemAssignments/' . \rawurlencode($sid) . ''; } /** * Fetch the ItemAssignmentInstance * * @return ItemAssignmentInstance Fetched ItemAssignmentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ItemAssignmentInstance { $payload = $this->version->fetch('GET', $this->uri); return new ItemAssignmentInstance( $this->version, $payload, $this->solution['bundleSid'], $this->solution['sid'] ); } /** * Delete the ItemAssignmentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Numbers/V2/RegulatoryCompliance/EndUserOptions.php 0000644 00000007436 15107452356 0016252 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance; use Twilio\Options; use Twilio\Values; abstract class EndUserOptions { /** * @param array $attributes The set of parameters that compose the End User * resource * @return CreateEndUserOptions Options builder */ public static function create(array $attributes = Values::ARRAY_NONE): CreateEndUserOptions { return new CreateEndUserOptions($attributes); } /** * @param string $friendlyName The string that you assigned to describe the * resource * @param array $attributes The set of parameters that compose the End User * resource * @return UpdateEndUserOptions Options builder */ public static function update(string $friendlyName = Values::NONE, array $attributes = Values::ARRAY_NONE): UpdateEndUserOptions { return new UpdateEndUserOptions($friendlyName, $attributes); } } class CreateEndUserOptions extends Options { /** * @param array $attributes The set of parameters that compose the End User * resource */ public function __construct(array $attributes = Values::ARRAY_NONE) { $this->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 compose the End User * resource * @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 compose the End User * resource */ 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 compose the End User * resource * @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 . ']'; } } Numbers/V2/RegulatoryCompliance/RegulationContext.php 0000644 00000003046 15107452356 0017000 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class RegulationContext extends InstanceContext { /** * Initialize the RegulationContext * * @param Version $version Version that contains the resource * @param string $sid The unique string that identifies the Regulation resource */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/RegulatoryCompliance/Regulations/' . \rawurlencode($sid) . ''; } /** * Fetch the RegulationInstance * * @return RegulationInstance Fetched RegulationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RegulationInstance { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Numbers/V2/RegulatoryCompliance/RegulationInstance.php 0000644 00000006356 15107452356 0017127 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $friendlyName * @property string $isoCountry * @property string $numberType * @property string $endUserType * @property array $requirements * @property string $url */ class RegulationInstance extends InstanceResource { /** * Initialize the RegulationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the Regulation resource */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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 * * @return RegulationInstance Fetched RegulationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RegulationInstance { 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.RegulationInstance ' . \implode(' ', $context) . ']'; } } Numbers/V2/RegulatoryCompliance/EndUserList.php 0000644 00000012776 15107452356 0015535 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class EndUserList extends ListResource { /** * Construct the EndUserList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/RegulatoryCompliance/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 * @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']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new EndUserInstance($this->version, $payload); } /** * 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']); } /** * 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); } /** * 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 that identifies the 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]'; } } Numbers/V2/RegulatoryCompliance/SupportingDocumentPage.php 0000644 00000002350 15107452356 0017765 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SupportingDocumentPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Numbers/V2/RegulatoryCompliance/SupportingDocumentContext.php 0000644 00000005214 15107452356 0020537 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class SupportingDocumentContext extends InstanceContext { /** * Initialize the SupportingDocumentContext * * @param Version $version Version that contains the resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/RegulatoryCompliance/SupportingDocuments/' . \rawurlencode($sid) . ''; } /** * Fetch the SupportingDocumentInstance * * @return SupportingDocumentInstance Fetched SupportingDocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SupportingDocumentInstance { $payload = $this->version->fetch('GET', $this->uri); 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']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SupportingDocumentInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the SupportingDocumentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Numbers/V2/RegulatoryCompliance/SupportingDocumentTypeInstance.php 0000644 00000006346 15107452356 0021530 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $friendlyName * @property string $machineName * @property array[] $fields * @property string $url */ class SupportingDocumentTypeInstance extends InstanceResource { /** * Initialize the SupportingDocumentTypeInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the Supporting Document * Type resource */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Numbers/V2/RegulatoryCompliance/EndUserTypeInstance.php 0000644 00000006065 15107452356 0017222 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $friendlyName * @property string $machineName * @property array[] $fields * @property string $url */ class EndUserTypeInstance extends InstanceResource { /** * Initialize the EndUserTypeInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the End-User Type * resource */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Numbers/V2/RegulatoryCompliance/BundleContext.php 0000644 00000013143 15107452356 0016077 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Numbers\V2\RegulatoryCompliance\Bundle\BundleCopyList; use Twilio\Rest\Numbers\V2\RegulatoryCompliance\Bundle\EvaluationList; use Twilio\Rest\Numbers\V2\RegulatoryCompliance\Bundle\ItemAssignmentList; use Twilio\Rest\Numbers\V2\RegulatoryCompliance\Bundle\ReplaceItemsList; use Twilio\Values; use Twilio\Version; /** * @property EvaluationList $evaluations * @property ItemAssignmentList $itemAssignments * @property BundleCopyList $bundleCopies * @property ReplaceItemsList $replaceItems * @method \Twilio\Rest\Numbers\V2\RegulatoryCompliance\Bundle\EvaluationContext evaluations(string $sid) * @method \Twilio\Rest\Numbers\V2\RegulatoryCompliance\Bundle\ItemAssignmentContext itemAssignments(string $sid) */ class BundleContext extends InstanceContext { protected $_evaluations; protected $_itemAssignments; protected $_bundleCopies; protected $_replaceItems; /** * Initialize the BundleContext * * @param Version $version Version that contains the resource * @param string $sid The unique string that identifies the resource. */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/RegulatoryCompliance/Bundles/' . \rawurlencode($sid) . ''; } /** * Fetch the BundleInstance * * @return BundleInstance Fetched BundleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): BundleInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new BundleInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the BundleInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Access the evaluations */ protected function getEvaluations(): EvaluationList { if (!$this->_evaluations) { $this->_evaluations = new EvaluationList($this->version, $this->solution['sid']); } return $this->_evaluations; } /** * Access the itemAssignments */ protected function getItemAssignments(): ItemAssignmentList { if (!$this->_itemAssignments) { $this->_itemAssignments = new ItemAssignmentList($this->version, $this->solution['sid']); } return $this->_itemAssignments; } /** * Access the bundleCopies */ protected function getBundleCopies(): BundleCopyList { if (!$this->_bundleCopies) { $this->_bundleCopies = new BundleCopyList($this->version, $this->solution['sid']); } return $this->_bundleCopies; } /** * Access the replaceItems */ protected function getReplaceItems(): ReplaceItemsList { if (!$this->_replaceItems) { $this->_replaceItems = new ReplaceItemsList($this->version, $this->solution['sid']); } return $this->_replaceItems; } /** * 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) . ']'; } } Numbers/V2/RegulatoryCompliance/BundleInstance.php 0000644 00000012635 15107452356 0016224 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Numbers\V2\RegulatoryCompliance\Bundle\BundleCopyList; use Twilio\Rest\Numbers\V2\RegulatoryCompliance\Bundle\EvaluationList; use Twilio\Rest\Numbers\V2\RegulatoryCompliance\Bundle\ItemAssignmentList; use Twilio\Rest\Numbers\V2\RegulatoryCompliance\Bundle\ReplaceItemsList; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $regulationSid * @property string $friendlyName * @property string $status * @property \DateTime $validUntil * @property string $email * @property string $statusCallback * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class BundleInstance extends InstanceResource { protected $_evaluations; protected $_itemAssignments; protected $_bundleCopies; protected $_replaceItems; /** * Initialize the BundleInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the resource. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Access the evaluations */ protected function getEvaluations(): EvaluationList { return $this->proxy()->evaluations; } /** * Access the itemAssignments */ protected function getItemAssignments(): ItemAssignmentList { return $this->proxy()->itemAssignments; } /** * Access the bundleCopies */ protected function getBundleCopies(): BundleCopyList { return $this->proxy()->bundleCopies; } /** * Access the replaceItems */ protected function getReplaceItems(): ReplaceItemsList { return $this->proxy()->replaceItems; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Numbers/V2/RegulatoryCompliance/EndUserTypePage.php 0000644 00000002276 15107452356 0016332 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class EndUserTypePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Numbers/V2/RegulatoryCompliance/SupportingDocumentOptions.php 0000644 00000010011 15107452356 0020535 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance; use Twilio\Options; use Twilio\Values; abstract class SupportingDocumentOptions { /** * @param array $attributes The set of parameters that compose the Supporting * Documents resource * @return CreateSupportingDocumentOptions Options builder */ public static function create(array $attributes = Values::ARRAY_NONE): CreateSupportingDocumentOptions { return new CreateSupportingDocumentOptions($attributes); } /** * @param string $friendlyName The string that you assigned to describe the * resource * @param array $attributes The set of parameters that compose the Supporting * Document resource * @return UpdateSupportingDocumentOptions Options builder */ public static function update(string $friendlyName = Values::NONE, array $attributes = Values::ARRAY_NONE): UpdateSupportingDocumentOptions { return new UpdateSupportingDocumentOptions($friendlyName, $attributes); } } class CreateSupportingDocumentOptions extends Options { /** * @param array $attributes The set of parameters that compose the Supporting * Documents resource */ public function __construct(array $attributes = Values::ARRAY_NONE) { $this->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 compose the Supporting * Documents resource * @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 compose the Supporting * Document resource */ 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 compose the Supporting * Document resource * @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 . ']'; } } Numbers/V2/RegulatoryCompliance/EndUserPage.php 0000644 00000002246 15107452356 0015465 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class EndUserPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Numbers/V2/RegulatoryCompliance/BundlePage.php 0000644 00000002240 15107452356 0015323 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class BundlePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Numbers/V2/RegulatoryCompliance/EndUserContext.php 0000644 00000004747 15107452356 0016245 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class EndUserContext extends InstanceContext { /** * Initialize the EndUserContext * * @param Version $version Version that contains the resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/RegulatoryCompliance/EndUsers/' . \rawurlencode($sid) . ''; } /** * Fetch the EndUserInstance * * @return EndUserInstance Fetched EndUserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): EndUserInstance { $payload = $this->version->fetch('GET', $this->uri); 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']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new EndUserInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the EndUserInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Numbers/V2/RegulatoryCompliance/SupportingDocumentInstance.php 0000644 00000010663 15107452356 0020663 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $friendlyName * @property string $mimeType * @property string $status * @property string $failureReason * @property string $type * @property array $attributes * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class SupportingDocumentInstance extends InstanceResource { /** * Initialize the SupportingDocumentInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Numbers/V2/RegulatoryCompliance/EndUserTypeList.php 0000644 00000011240 15107452356 0016360 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class EndUserTypeList extends ListResource { /** * Construct the EndUserTypeList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/RegulatoryCompliance/EndUserTypes'; } /** * 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']); } /** * 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); } /** * 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]'; } } Numbers/V2/RegulatoryCompliance/SupportingDocumentTypeList.php 0000644 00000011634 15107452356 0020673 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class SupportingDocumentTypeList extends ListResource { /** * Construct the SupportingDocumentTypeList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/RegulatoryCompliance/SupportingDocumentTypes'; } /** * 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']); } /** * 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); } /** * 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]'; } } Numbers/V2/RegulatoryCompliance/RegulationList.php 0000644 00000012163 15107452356 0016267 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class RegulationList extends ListResource { /** * Construct the RegulationList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/RegulatoryCompliance/Regulations'; } /** * 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']); } /** * 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); } /** * Retrieve a single page of RegulationInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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'], '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]'; } } Numbers/V2/RegulatoryCompliance/SupportingDocumentList.php 0000644 00000013420 15107452356 0020024 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class SupportingDocumentList extends ListResource { /** * Construct the SupportingDocumentList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SupportingDocumentInstance($this->version, $payload); } /** * 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']); } /** * 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); } /** * 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 that identifies the 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]'; } } Numbers/V2/RegulatoryCompliance/EndUserTypeContext.php 0000644 00000003114 15107452356 0017072 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class EndUserTypeContext extends InstanceContext { /** * Initialize the EndUserTypeContext * * @param Version $version Version that contains the resource * @param string $sid The unique string that identifies the End-User Type * resource */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Numbers/V2/RegulatoryCompliance/BundleList.php 0000644 00000015312 15107452356 0015366 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2\RegulatoryCompliance; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class BundleList extends ListResource { /** * Construct the BundleList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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 * @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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new BundleInstance($this->version, $payload); } /** * 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']); } /** * 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); } /** * Retrieve a single page of BundleInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 identifies the 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]'; } } Numbers/V2/RegulatoryCompliancePage.php 0000644 00000002312 15107452356 0014112 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RegulatoryCompliancePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Numbers/V2/RegulatoryComplianceList.php 0000644 00000012065 15107452356 0014157 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Numbers\V2\RegulatoryCompliance\BundleList; use Twilio\Rest\Numbers\V2\RegulatoryCompliance\EndUserList; use Twilio\Rest\Numbers\V2\RegulatoryCompliance\EndUserTypeList; use Twilio\Rest\Numbers\V2\RegulatoryCompliance\RegulationList; use Twilio\Rest\Numbers\V2\RegulatoryCompliance\SupportingDocumentList; use Twilio\Rest\Numbers\V2\RegulatoryCompliance\SupportingDocumentTypeList; use Twilio\Version; /** * @property BundleList $bundles * @property EndUserList $endUsers * @property EndUserTypeList $endUserTypes * @property RegulationList $regulations * @property SupportingDocumentList $supportingDocuments * @property SupportingDocumentTypeList $supportingDocumentTypes * @method \Twilio\Rest\Numbers\V2\RegulatoryCompliance\BundleContext bundles(string $sid) * @method \Twilio\Rest\Numbers\V2\RegulatoryCompliance\EndUserContext endUsers(string $sid) * @method \Twilio\Rest\Numbers\V2\RegulatoryCompliance\EndUserTypeContext endUserTypes(string $sid) * @method \Twilio\Rest\Numbers\V2\RegulatoryCompliance\RegulationContext regulations(string $sid) * @method \Twilio\Rest\Numbers\V2\RegulatoryCompliance\SupportingDocumentContext supportingDocuments(string $sid) * @method \Twilio\Rest\Numbers\V2\RegulatoryCompliance\SupportingDocumentTypeContext supportingDocumentTypes(string $sid) */ class RegulatoryComplianceList extends ListResource { protected $_bundles = null; protected $_endUsers = null; protected $_endUserTypes = null; protected $_regulations = null; protected $_supportingDocuments = null; protected $_supportingDocumentTypes = null; /** * Construct the RegulatoryComplianceList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; } /** * Access the bundles */ protected function getBundles(): BundleList { if (!$this->_bundles) { $this->_bundles = new BundleList($this->version); } return $this->_bundles; } /** * Access the endUsers */ protected function getEndUsers(): EndUserList { if (!$this->_endUsers) { $this->_endUsers = new EndUserList($this->version); } return $this->_endUsers; } /** * Access the endUserTypes */ protected function getEndUserTypes(): EndUserTypeList { if (!$this->_endUserTypes) { $this->_endUserTypes = new EndUserTypeList($this->version); } return $this->_endUserTypes; } /** * 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 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]'; } } Numbers/V2/RegulatoryComplianceInstance.php 0000644 00000002706 15107452356 0015011 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; class RegulatoryComplianceInstance extends InstanceResource { /** * Initialize the RegulatoryComplianceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); $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.V2.RegulatoryComplianceInstance]'; } } Numbers/V2.php 0000644 00000004331 15107452356 0007170 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Numbers; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Numbers\V2\RegulatoryComplianceList; use Twilio\Version; /** * @property RegulatoryComplianceList $regulatoryCompliance */ class V2 extends Version { protected $_regulatoryCompliance; /** * Construct the V2 version of Numbers * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v2'; } 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]'; } } Trunking.php 0000644 00000004752 15107452356 0007076 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Trunking\V1; /** * @property \Twilio\Rest\Trunking\V1 $v1 * @property \Twilio\Rest\Trunking\V1\TrunkList $trunks * @method \Twilio\Rest\Trunking\V1\TrunkContext trunks(string $sid) */ class Trunking extends Domain { protected $_v1; /** * Construct the Trunking Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->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); } protected function getTrunks(): \Twilio\Rest\Trunking\V1\TrunkList { return $this->v1->trunks; } /** * @param string $sid The unique string that identifies the resource */ protected function contextTrunks(string $sid): \Twilio\Rest\Trunking\V1\TrunkContext { return $this->v1->trunks($sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trunking]'; } } Api.php 0000644 00000033574 15107452356 0006012 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Api\V2010; /** * @property \Twilio\Rest\Api\V2010 $v2010 * @property \Twilio\Rest\Api\V2010\AccountList $accounts * @property \Twilio\Rest\Api\V2010\AccountContext $account * @property \Twilio\Rest\Api\V2010\Account\AddressList $addresses * @property \Twilio\Rest\Api\V2010\Account\ApplicationList $applications * @property \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList $authorizedConnectApps * @property \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList $availablePhoneNumbers * @property \Twilio\Rest\Api\V2010\Account\BalanceList $balance * @property \Twilio\Rest\Api\V2010\Account\CallList $calls * @property \Twilio\Rest\Api\V2010\Account\ConferenceList $conferences * @property \Twilio\Rest\Api\V2010\Account\ConnectAppList $connectApps * @property \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList $incomingPhoneNumbers * @property \Twilio\Rest\Api\V2010\Account\KeyList $keys * @property \Twilio\Rest\Api\V2010\Account\MessageList $messages * @property \Twilio\Rest\Api\V2010\Account\NewKeyList $newKeys * @property \Twilio\Rest\Api\V2010\Account\NewSigningKeyList $newSigningKeys * @property \Twilio\Rest\Api\V2010\Account\NotificationList $notifications * @property \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList $outgoingCallerIds * @property \Twilio\Rest\Api\V2010\Account\QueueList $queues * @property \Twilio\Rest\Api\V2010\Account\RecordingList $recordings * @property \Twilio\Rest\Api\V2010\Account\SigningKeyList $signingKeys * @property \Twilio\Rest\Api\V2010\Account\SipList $sip * @property \Twilio\Rest\Api\V2010\Account\ShortCodeList $shortCodes * @property \Twilio\Rest\Api\V2010\Account\TokenList $tokens * @property \Twilio\Rest\Api\V2010\Account\TranscriptionList $transcriptions * @property \Twilio\Rest\Api\V2010\Account\UsageList $usage * @property \Twilio\Rest\Api\V2010\Account\ValidationRequestList $validationRequests * @method \Twilio\Rest\Api\V2010\Account\AddressContext addresses(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ApplicationContext applications(string $sid) * @method \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppContext authorizedConnectApps(string $connectAppSid) * @method \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryContext availablePhoneNumbers(string $countryCode) * @method \Twilio\Rest\Api\V2010\Account\CallContext calls(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ConferenceContext conferences(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ConnectAppContext connectApps(string $sid) * @method \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberContext incomingPhoneNumbers(string $sid) * @method \Twilio\Rest\Api\V2010\Account\KeyContext keys(string $sid) * @method \Twilio\Rest\Api\V2010\Account\MessageContext messages(string $sid) * @method \Twilio\Rest\Api\V2010\Account\NotificationContext notifications(string $sid) * @method \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdContext outgoingCallerIds(string $sid) * @method \Twilio\Rest\Api\V2010\Account\QueueContext queues(string $sid) * @method \Twilio\Rest\Api\V2010\Account\RecordingContext recordings(string $sid) * @method \Twilio\Rest\Api\V2010\Account\SigningKeyContext signingKeys(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ShortCodeContext shortCodes(string $sid) * @method \Twilio\Rest\Api\V2010\Account\TranscriptionContext transcriptions(string $sid) * @method \Twilio\Rest\Api\V2010\AccountContext accounts(string $sid) */ class Api extends Domain { protected $_v2010; /** * Construct the Api Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->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); } /** * @return \Twilio\Rest\Api\V2010\AccountContext Account provided as the * authenticating account */ protected function getAccount(): \Twilio\Rest\Api\V2010\AccountContext { return $this->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); } protected function getAddresses(): \Twilio\Rest\Api\V2010\Account\AddressList { return $this->v2010->account->addresses; } /** * @param string $sid The unique string that identifies the resource */ protected function contextAddresses(string $sid): \Twilio\Rest\Api\V2010\Account\AddressContext { return $this->v2010->account->addresses($sid); } protected function getApplications(): \Twilio\Rest\Api\V2010\Account\ApplicationList { return $this->v2010->account->applications; } /** * @param string $sid The unique string that identifies the resource */ protected function contextApplications(string $sid): \Twilio\Rest\Api\V2010\Account\ApplicationContext { return $this->v2010->account->applications($sid); } protected function getAuthorizedConnectApps(): \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList { return $this->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->v2010->account->authorizedConnectApps($connectAppSid); } protected function getAvailablePhoneNumbers(): \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList { return $this->v2010->account->availablePhoneNumbers; } /** * @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 { return $this->v2010->account->availablePhoneNumbers($countryCode); } protected function getBalance(): \Twilio\Rest\Api\V2010\Account\BalanceList { return $this->v2010->account->balance; } protected function getCalls(): \Twilio\Rest\Api\V2010\Account\CallList { return $this->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->v2010->account->calls($sid); } protected function getConferences(): \Twilio\Rest\Api\V2010\Account\ConferenceList { return $this->v2010->account->conferences; } /** * @param string $sid The unique string that identifies this resource */ protected function contextConferences(string $sid): \Twilio\Rest\Api\V2010\Account\ConferenceContext { return $this->v2010->account->conferences($sid); } protected function getConnectApps(): \Twilio\Rest\Api\V2010\Account\ConnectAppList { return $this->v2010->account->connectApps; } /** * @param string $sid The unique string that identifies the resource */ protected function contextConnectApps(string $sid): \Twilio\Rest\Api\V2010\Account\ConnectAppContext { return $this->v2010->account->connectApps($sid); } protected function getIncomingPhoneNumbers(): \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList { return $this->v2010->account->incomingPhoneNumbers; } /** * @param string $sid The unique string that identifies the resource */ protected function contextIncomingPhoneNumbers(string $sid): \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberContext { return $this->v2010->account->incomingPhoneNumbers($sid); } protected function getKeys(): \Twilio\Rest\Api\V2010\Account\KeyList { return $this->v2010->account->keys; } /** * @param string $sid The unique string that identifies the resource */ protected function contextKeys(string $sid): \Twilio\Rest\Api\V2010\Account\KeyContext { return $this->v2010->account->keys($sid); } protected function getMessages(): \Twilio\Rest\Api\V2010\Account\MessageList { return $this->v2010->account->messages; } /** * @param string $sid The unique string that identifies the resource */ protected function contextMessages(string $sid): \Twilio\Rest\Api\V2010\Account\MessageContext { return $this->v2010->account->messages($sid); } protected function getNewKeys(): \Twilio\Rest\Api\V2010\Account\NewKeyList { return $this->v2010->account->newKeys; } protected function getNewSigningKeys(): \Twilio\Rest\Api\V2010\Account\NewSigningKeyList { return $this->v2010->account->newSigningKeys; } protected function getNotifications(): \Twilio\Rest\Api\V2010\Account\NotificationList { return $this->v2010->account->notifications; } /** * @param string $sid The unique string that identifies the resource */ protected function contextNotifications(string $sid): \Twilio\Rest\Api\V2010\Account\NotificationContext { return $this->v2010->account->notifications($sid); } protected function getOutgoingCallerIds(): \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList { return $this->v2010->account->outgoingCallerIds; } /** * @param string $sid The unique string that identifies the resource */ protected function contextOutgoingCallerIds(string $sid): \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdContext { return $this->v2010->account->outgoingCallerIds($sid); } protected function getQueues(): \Twilio\Rest\Api\V2010\Account\QueueList { return $this->v2010->account->queues; } /** * @param string $sid The unique string that identifies this resource */ protected function contextQueues(string $sid): \Twilio\Rest\Api\V2010\Account\QueueContext { return $this->v2010->account->queues($sid); } protected function getRecordings(): \Twilio\Rest\Api\V2010\Account\RecordingList { return $this->v2010->account->recordings; } /** * @param string $sid The unique string that identifies the resource */ protected function contextRecordings(string $sid): \Twilio\Rest\Api\V2010\Account\RecordingContext { return $this->v2010->account->recordings($sid); } protected function getSigningKeys(): \Twilio\Rest\Api\V2010\Account\SigningKeyList { return $this->v2010->account->signingKeys; } /** * @param string $sid The sid */ protected function contextSigningKeys(string $sid): \Twilio\Rest\Api\V2010\Account\SigningKeyContext { return $this->v2010->account->signingKeys($sid); } protected function getSip(): \Twilio\Rest\Api\V2010\Account\SipList { return $this->v2010->account->sip; } protected function getShortCodes(): \Twilio\Rest\Api\V2010\Account\ShortCodeList { return $this->v2010->account->shortCodes; } /** * @param string $sid The unique string that identifies this resource */ protected function contextShortCodes(string $sid): \Twilio\Rest\Api\V2010\Account\ShortCodeContext { return $this->v2010->account->shortCodes($sid); } protected function getTokens(): \Twilio\Rest\Api\V2010\Account\TokenList { return $this->v2010->account->tokens; } protected function getTranscriptions(): \Twilio\Rest\Api\V2010\Account\TranscriptionList { return $this->v2010->account->transcriptions; } /** * @param string $sid The unique string that identifies the resource */ protected function contextTranscriptions(string $sid): \Twilio\Rest\Api\V2010\Account\TranscriptionContext { return $this->v2010->account->transcriptions($sid); } protected function getUsage(): \Twilio\Rest\Api\V2010\Account\UsageList { return $this->v2010->account->usage; } protected function getValidationRequests(): \Twilio\Rest\Api\V2010\Account\ValidationRequestList { return $this->v2010->account->validationRequests; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api]'; } } Voice.php 0000644 00000011614 15107452356 0006335 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Voice\V1; /** * @property \Twilio\Rest\Voice\V1 $v1 * @property \Twilio\Rest\Voice\V1\ArchivedCallList $archivedCalls * @property \Twilio\Rest\Voice\V1\ByocTrunkList $byocTrunks * @property \Twilio\Rest\Voice\V1\ConnectionPolicyList $connectionPolicies * @property \Twilio\Rest\Voice\V1\DialingPermissionsList $dialingPermissions * @property \Twilio\Rest\Voice\V1\IpRecordList $ipRecords * @property \Twilio\Rest\Voice\V1\SourceIpMappingList $sourceIpMappings * @method \Twilio\Rest\Voice\V1\ArchivedCallContext archivedCalls(\DateTime $date, string $sid) * @method \Twilio\Rest\Voice\V1\ByocTrunkContext byocTrunks(string $sid) * @method \Twilio\Rest\Voice\V1\ConnectionPolicyContext connectionPolicies(string $sid) * @method \Twilio\Rest\Voice\V1\IpRecordContext ipRecords(string $sid) * @method \Twilio\Rest\Voice\V1\SourceIpMappingContext sourceIpMappings(string $sid) */ class Voice extends Domain { protected $_v1; /** * Construct the Voice Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->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); } protected function getArchivedCalls(): \Twilio\Rest\Voice\V1\ArchivedCallList { return $this->v1->archivedCalls; } /** * @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 { return $this->v1->archivedCalls($date, $sid); } protected function getByocTrunks(): \Twilio\Rest\Voice\V1\ByocTrunkList { return $this->v1->byocTrunks; } /** * @param string $sid The unique string that identifies the resource */ protected function contextByocTrunks(string $sid): \Twilio\Rest\Voice\V1\ByocTrunkContext { return $this->v1->byocTrunks($sid); } protected function getConnectionPolicies(): \Twilio\Rest\Voice\V1\ConnectionPolicyList { return $this->v1->connectionPolicies; } /** * @param string $sid The unique string that identifies the resource */ protected function contextConnectionPolicies(string $sid): \Twilio\Rest\Voice\V1\ConnectionPolicyContext { return $this->v1->connectionPolicies($sid); } protected function getDialingPermissions(): \Twilio\Rest\Voice\V1\DialingPermissionsList { return $this->v1->dialingPermissions; } protected function getIpRecords(): \Twilio\Rest\Voice\V1\IpRecordList { return $this->v1->ipRecords; } /** * @param string $sid The unique string that identifies the resource */ protected function contextIpRecords(string $sid): \Twilio\Rest\Voice\V1\IpRecordContext { return $this->v1->ipRecords($sid); } protected function getSourceIpMappings(): \Twilio\Rest\Voice\V1\SourceIpMappingList { return $this->v1->sourceIpMappings; } /** * @param string $sid The unique string that identifies the resource */ protected function contextSourceIpMappings(string $sid): \Twilio\Rest\Voice\V1\SourceIpMappingContext { return $this->v1->sourceIpMappings($sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice]'; } } Chat.php 0000644 00000010057 15107452356 0006147 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Chat\V1; use Twilio\Rest\Chat\V2; use Twilio\Rest\Chat\V3; /** * @property \Twilio\Rest\Chat\V1 $v1 * @property \Twilio\Rest\Chat\V2 $v2 * @property \Twilio\Rest\Chat\V3 $v3 * @property \Twilio\Rest\Chat\V2\CredentialList $credentials * @property \Twilio\Rest\Chat\V2\ServiceList $services * @property \Twilio\Rest\Chat\V3\ChannelList $channels * @method \Twilio\Rest\Chat\V2\CredentialContext credentials(string $sid) * @method \Twilio\Rest\Chat\V2\ServiceContext services(string $sid) * @method \Twilio\Rest\Chat\V3\ChannelContext channels(string $serviceSid, string $sid) */ class Chat extends Domain { protected $_v1; protected $_v2; protected $_v3; /** * Construct the Chat Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->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); } protected function getCredentials(): \Twilio\Rest\Chat\V2\CredentialList { return $this->v2->credentials; } /** * @param string $sid The SID of the Credential resource to fetch */ protected function contextCredentials(string $sid): \Twilio\Rest\Chat\V2\CredentialContext { return $this->v2->credentials($sid); } protected function getServices(): \Twilio\Rest\Chat\V2\ServiceList { return $this->v2->services; } /** * @param string $sid The SID of the Service resource to fetch */ protected function contextServices(string $sid): \Twilio\Rest\Chat\V2\ServiceContext { return $this->v2->services($sid); } protected function getChannels(): \Twilio\Rest\Chat\V3\ChannelList { return $this->v3->channels; } /** * @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 { return $this->v3->channels($serviceSid, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat]'; } } Content/V1/ContentContext.php 0000644 00000007076 15107452357 0012157 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Content\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Content\V1\Content\ApprovalFetchList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property ApprovalFetchList $approvalFetch * @method \Twilio\Rest\Content\V1\Content\ApprovalFetchContext approvalFetch() */ class ContentContext extends InstanceContext { protected $_approvalFetch; /** * Initialize the ContentContext * * @param Version $version Version that contains the resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Content/' . \rawurlencode($sid) . ''; } /** * Fetch the ContentInstance * * @return ContentInstance Fetched ContentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ContentInstance { $payload = $this->version->fetch('GET', $this->uri); return new ContentInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the ContentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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) . ']'; } } Content/V1/LegacyContentPage.php 0000644 00000002553 15107452357 0012527 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Content\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class LegacyContentPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Content/V1/ContentList.php 0000644 00000011310 15107452357 0011430 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Content\V1; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ContentList extends ListResource { /** * Construct the ContentList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Content'; } /** * 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']); } /** * 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); } /** * 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 unique string that identifies the resource */ 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]'; } } Content/V1/ContentPage.php 0000644 00000002507 15107452357 0011401 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Content\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ContentPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Content/V1/Content/ApprovalFetchList.php 0000644 00000002371 15107452357 0014175 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Content\V1\Content; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ApprovalFetchList extends ListResource { /** * Construct the ApprovalFetchList * * @param Version $version Version that contains the resource * @param string $sid The unique string that identifies the Content resource */ public function __construct(Version $version, string $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; } /** * Constructs a ApprovalFetchContext */ public function getContext(): ApprovalFetchContext { return new ApprovalFetchContext($this->version, $this->solution['sid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Content.V1.ApprovalFetchList]'; } } Content/V1/Content/ApprovalFetchContext.php 0000644 00000003361 15107452357 0014706 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Content\V1\Content; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ApprovalFetchContext extends InstanceContext { /** * Initialize the ApprovalFetchContext * * @param Version $version Version that contains the resource * @param string $sid The unique string that identifies the Content resource */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Content/' . \rawurlencode($sid) . '/ApprovalRequests'; } /** * Fetch the ApprovalFetchInstance * * @return ApprovalFetchInstance Fetched ApprovalFetchInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ApprovalFetchInstance { $payload = $this->version->fetch('GET', $this->uri); return new ApprovalFetchInstance($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.Content.V1.ApprovalFetchContext ' . \implode(' ', $context) . ']'; } } Content/V1/Content/ApprovalFetchPage.php 0000644 00000002623 15107452357 0014136 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Content\V1\Content; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ApprovalFetchPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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['sid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Content.V1.ApprovalFetchPage]'; } } Content/V1/Content/ApprovalFetchInstance.php 0000644 00000006124 15107452357 0015026 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Content\V1\Content; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $accountSid * @property array $whatsapp * @property string $url */ class ApprovalFetchInstance extends InstanceResource { /** * Initialize the ApprovalFetchInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the Content resource */ public function __construct(Version $version, array $payload, string $sid) { parent::__construct($version); // Marshaled Properties $this->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 = ['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 ApprovalFetchContext Context for this ApprovalFetchInstance */ protected function proxy(): ApprovalFetchContext { if (!$this->context) { $this->context = new ApprovalFetchContext($this->version, $this->solution['sid']); } 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) . ']'; } } Content/V1/ContentInstance.php 0000644 00000010306 15107452357 0012265 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Content\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Rest\Content\V1\Content\ApprovalFetchList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $sid * @property string $accountSid * @property string $friendlyName * @property string $language * @property array $variables * @property array $types * @property string $url * @property array $links */ class ContentInstance extends InstanceResource { protected $_approvalFetch; /** * Initialize the ContentInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the ContentInstance * * @return ContentInstance Fetched ContentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ContentInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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) . ']'; } } Content/V1/LegacyContentInstance.php 0000644 00000005551 15107452357 0013420 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Content\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $sid * @property string $accountSid * @property string $friendlyName * @property string $language * @property array $variables * @property array $types * @property string $legacyTemplateName * @property string $legacyBody * @property string $url */ class LegacyContentInstance extends InstanceResource { /** * Initialize the LegacyContentInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Content/V1/LegacyContentList.php 0000644 00000011055 15107452357 0012563 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Content\V1; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class LegacyContentList extends ListResource { /** * Construct the LegacyContentList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/LegacyContent'; } /** * 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']); } /** * 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); } /** * 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]'; } } Content/V1.php 0000644 00000005004 15107452357 0007165 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Content; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Content\V1\ContentList; use Twilio\Rest\Content\V1\LegacyContentList; use Twilio\Version; /** * @property ContentList $contents * @property LegacyContentList $legacyContents * @method \Twilio\Rest\Content\V1\ContentContext contents(string $sid) */ class V1 extends Version { protected $_contents; protected $_legacyContents; /** * Construct the V1 version of Content * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } protected function getContents(): ContentList { if (!$this->_contents) { $this->_contents = new ContentList($this); } return $this->_contents; } 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]'; } } Insights/V1/RoomList.php 0000644 00000012500 15107452357 0011112 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class RoomList extends ListResource { /** * Construct the RoomList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Video/Rooms'; } /** * 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']); } /** * 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); } /** * Retrieve a single page of RoomInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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' => Serialize::map($options['roomType'], function($e) { return $e; }), 'Codec' => Serialize::map($options['codec'], function($e) { return $e; }), '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]'; } } Insights/V1/CallContext.php 0000644 00000010205 15107452357 0011562 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Insights\V1\Call\AnnotationList; use Twilio\Rest\Insights\V1\Call\CallSummaryList; use Twilio\Rest\Insights\V1\Call\EventList; use Twilio\Rest\Insights\V1\Call\MetricList; use Twilio\Values; use Twilio\Version; /** * @property EventList $events * @property MetricList $metrics * @property CallSummaryList $summary * @property AnnotationList $annotation * @method \Twilio\Rest\Insights\V1\Call\CallSummaryContext summary() * @method \Twilio\Rest\Insights\V1\Call\AnnotationContext annotation() */ class CallContext extends InstanceContext { protected $_events; protected $_metrics; protected $_summary; protected $_annotation; /** * Initialize the CallContext * * @param Version $version Version that contains the resource * @param string $sid The sid */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); return new CallInstance($this->version, $payload, $this->solution['sid']); } /** * Access the events */ protected function getEvents(): EventList { if (!$this->_events) { $this->_events = new EventList($this->version, $this->solution['sid']); } return $this->_events; } /** * Access the metrics */ protected function getMetrics(): MetricList { if (!$this->_metrics) { $this->_metrics = new MetricList($this->version, $this->solution['sid']); } return $this->_metrics; } /** * 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) . ']'; } } Insights/V1/Conference/ConferenceParticipantInstance.php 0000644 00000013673 15107452357 0017360 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Conference; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $participantSid * @property string $label * @property string $conferenceSid * @property string $callSid * @property string $accountSid * @property string $callDirection * @property string $from * @property string $to * @property string $callStatus * @property string $countryCode * @property bool $isModerator * @property \DateTime $joinTime * @property \DateTime $leaveTime * @property int $durationSeconds * @property int $outboundQueueLength * @property int $outboundTimeInQueue * @property string $jitterBufferSize * @property bool $isCoach * @property string[] $coachedParticipants * @property string $participantRegion * @property string $conferenceRegion * @property string $callType * @property string $processingState * @property array $properties * @property array $events * @property array $metrics * @property string $url */ class ConferenceParticipantInstance extends InstanceResource { /** * Initialize the ConferenceParticipantInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $conferenceSid Conference SID. * @param string $participantSid Participant SID. */ public function __construct(Version $version, array $payload, string $conferenceSid, string $participantSid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Insights/V1/Conference/ConferenceParticipantOptions.php 0000644 00000011342 15107452357 0017236 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Conference; use Twilio\Options; use Twilio\Values; abstract class ConferenceParticipantOptions { /** * @param string $events Conference events generated by application or * participant activity. * @param string $metrics Object. Contains call quality metrics. * @return FetchConferenceParticipantOptions Options builder */ public static function fetch(string $events = Values::NONE, string $metrics = Values::NONE): FetchConferenceParticipantOptions { return new FetchConferenceParticipantOptions($events, $metrics); } /** * @param string $participantSid Participant SID. * @param string $label User-specified label for a participant. * @param string $events Conference events generated by application or * participant activity. * @return ReadConferenceParticipantOptions Options builder */ public static function read(string $participantSid = Values::NONE, string $label = Values::NONE, string $events = Values::NONE): ReadConferenceParticipantOptions { return new ReadConferenceParticipantOptions($participantSid, $label, $events); } } class FetchConferenceParticipantOptions extends Options { /** * @param string $events Conference events generated by application or * participant activity. * @param string $metrics Object. Contains call quality metrics. */ public function __construct(string $events = Values::NONE, string $metrics = Values::NONE) { $this->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. * @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 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 Participant SID. * @param string $label User-specified label for a participant. * @param string $events Conference events generated by application or * participant activity. */ 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 Participant SID. * @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. * @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 . ']'; } } Insights/V1/Conference/ConferenceParticipantList.php 0000644 00000013022 15107452357 0016513 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Conference; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ConferenceParticipantList extends ListResource { /** * Construct the ConferenceParticipantList * * @param Version $version Version that contains the resource * @param string $conferenceSid Conference SID. */ public function __construct(Version $version, string $conferenceSid) { parent::__construct($version); // Path Solution $this->solution = ['conferenceSid' => $conferenceSid, ]; $this->uri = '/Conferences/' . \rawurlencode($conferenceSid) . '/Participants'; } /** * 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']); } /** * 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); } /** * Retrieve a single page of ConferenceParticipantInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 Participant SID. */ 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]'; } } Insights/V1/Conference/ConferenceParticipantContext.php 0000644 00000004147 15107452357 0017234 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Conference; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class ConferenceParticipantContext extends InstanceContext { /** * Initialize the ConferenceParticipantContext * * @param Version $version Version that contains the resource * @param string $conferenceSid Conference SID. * @param string $participantSid Participant SID. */ public function __construct(Version $version, $conferenceSid, $participantSid) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->fetch('GET', $this->uri, $params); 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) . ']'; } } Insights/V1/Conference/ConferenceParticipantPage.php 0000644 00000002471 15107452357 0016462 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Conference; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ConferenceParticipantPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Insights/V1/RoomContext.php 0000644 00000006304 15107452357 0011630 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Insights\V1\Room\ParticipantList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property ParticipantList $participants * @method \Twilio\Rest\Insights\V1\Room\ParticipantContext participants(string $participantSid) */ class RoomContext extends InstanceContext { protected $_participants; /** * Initialize the RoomContext * * @param Version $version Version that contains the resource * @param string $roomSid The SID of the Room resource. */ public function __construct(Version $version, $roomSid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Insights/V1/CallSummariesPage.php 0000644 00000002243 15107452357 0012703 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CallSummariesPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Insights/V1/RoomOptions.php 0000644 00000010252 15107452357 0011634 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ abstract class RoomOptions { /** * @param string[] $roomType Type of room. * @param string[] $codec Codecs used by participants in the room. * @param string $roomName Room friendly name. * @param \DateTime $createdAfter Only read rooms that started on or after this * ISO 8601 timestamp. * @param \DateTime $createdBefore Only read rooms that started before this ISO * 8601 timestamp. * @return ReadRoomOptions Options builder */ public static function read(array $roomType = Values::ARRAY_NONE, array $codec = Values::ARRAY_NONE, string $roomName = Values::NONE, \DateTime $createdAfter = Values::NONE, \DateTime $createdBefore = Values::NONE): ReadRoomOptions { return new ReadRoomOptions($roomType, $codec, $roomName, $createdAfter, $createdBefore); } } class ReadRoomOptions extends Options { /** * @param string[] $roomType Type of room. * @param string[] $codec Codecs used by participants in the room. * @param string $roomName Room friendly name. * @param \DateTime $createdAfter Only read rooms that started on or after this * ISO 8601 timestamp. * @param \DateTime $createdBefore Only read rooms that started before this ISO * 8601 timestamp. */ public function __construct(array $roomType = Values::ARRAY_NONE, array $codec = Values::ARRAY_NONE, string $roomName = Values::NONE, \DateTime $createdAfter = Values::NONE, \DateTime $createdBefore = Values::NONE) { $this->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. * @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. * @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 . ']'; } } Insights/V1/CallList.php 0000644 00000001647 15107452357 0011063 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1; use Twilio\ListResource; use Twilio\Version; class CallList extends ListResource { /** * Construct the CallList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; } /** * Constructs a CallContext * * @param string $sid The 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]'; } } Insights/V1/CallSummariesOptions.php 0000644 00000023011 15107452357 0013456 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1; use Twilio\Options; use Twilio\Values; abstract class CallSummariesOptions { /** * @param string $from The from * @param string $to The to * @param string $fromCarrier The from_carrier * @param string $toCarrier The to_carrier * @param string $fromCountryCode The from_country_code * @param string $toCountryCode The to_country_code * @param bool $branded The branded * @param bool $verifiedCaller The verified_caller * @param bool $hasTag The has_tag * @param string $startTime The start_time * @param string $endTime The end_time * @param string $callType The call_type * @param string $callState The call_state * @param string $direction The direction * @param string $processingState The processing_state * @param string $sortBy The sort_by * @param string $subaccount The subaccount * @param bool $abnormalSession The abnormal_session * @return ReadCallSummariesOptions Options builder */ public static function read(string $from = Values::NONE, string $to = Values::NONE, string $fromCarrier = Values::NONE, string $toCarrier = Values::NONE, string $fromCountryCode = Values::NONE, string $toCountryCode = Values::NONE, bool $branded = Values::NONE, bool $verifiedCaller = Values::NONE, bool $hasTag = Values::NONE, string $startTime = Values::NONE, string $endTime = Values::NONE, string $callType = Values::NONE, string $callState = Values::NONE, string $direction = Values::NONE, string $processingState = Values::NONE, string $sortBy = Values::NONE, string $subaccount = Values::NONE, bool $abnormalSession = Values::NONE): ReadCallSummariesOptions { return new ReadCallSummariesOptions($from, $to, $fromCarrier, $toCarrier, $fromCountryCode, $toCountryCode, $branded, $verifiedCaller, $hasTag, $startTime, $endTime, $callType, $callState, $direction, $processingState, $sortBy, $subaccount, $abnormalSession); } } class ReadCallSummariesOptions extends Options { /** * @param string $from The from * @param string $to The to * @param string $fromCarrier The from_carrier * @param string $toCarrier The to_carrier * @param string $fromCountryCode The from_country_code * @param string $toCountryCode The to_country_code * @param bool $branded The branded * @param bool $verifiedCaller The verified_caller * @param bool $hasTag The has_tag * @param string $startTime The start_time * @param string $endTime The end_time * @param string $callType The call_type * @param string $callState The call_state * @param string $direction The direction * @param string $processingState The processing_state * @param string $sortBy The sort_by * @param string $subaccount The subaccount * @param bool $abnormalSession The abnormal_session */ public function __construct(string $from = Values::NONE, string $to = Values::NONE, string $fromCarrier = Values::NONE, string $toCarrier = Values::NONE, string $fromCountryCode = Values::NONE, string $toCountryCode = Values::NONE, bool $branded = Values::NONE, bool $verifiedCaller = Values::NONE, bool $hasTag = Values::NONE, string $startTime = Values::NONE, string $endTime = Values::NONE, string $callType = Values::NONE, string $callState = Values::NONE, string $direction = Values::NONE, string $processingState = Values::NONE, string $sortBy = Values::NONE, string $subaccount = Values::NONE, bool $abnormalSession = Values::NONE) { $this->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; } /** * The from * * @param string $from The from * @return $this Fluent Builder */ public function setFrom(string $from): self { $this->options['from'] = $from; return $this; } /** * The to * * @param string $to The to * @return $this Fluent Builder */ public function setTo(string $to): self { $this->options['to'] = $to; return $this; } /** * The from_carrier * * @param string $fromCarrier The from_carrier * @return $this Fluent Builder */ public function setFromCarrier(string $fromCarrier): self { $this->options['fromCarrier'] = $fromCarrier; return $this; } /** * The to_carrier * * @param string $toCarrier The to_carrier * @return $this Fluent Builder */ public function setToCarrier(string $toCarrier): self { $this->options['toCarrier'] = $toCarrier; return $this; } /** * The from_country_code * * @param string $fromCountryCode The from_country_code * @return $this Fluent Builder */ public function setFromCountryCode(string $fromCountryCode): self { $this->options['fromCountryCode'] = $fromCountryCode; return $this; } /** * The to_country_code * * @param string $toCountryCode The to_country_code * @return $this Fluent Builder */ public function setToCountryCode(string $toCountryCode): self { $this->options['toCountryCode'] = $toCountryCode; return $this; } /** * The branded * * @param bool $branded The branded * @return $this Fluent Builder */ public function setBranded(bool $branded): self { $this->options['branded'] = $branded; return $this; } /** * The verified_caller * * @param bool $verifiedCaller The verified_caller * @return $this Fluent Builder */ public function setVerifiedCaller(bool $verifiedCaller): self { $this->options['verifiedCaller'] = $verifiedCaller; return $this; } /** * The has_tag * * @param bool $hasTag The has_tag * @return $this Fluent Builder */ public function setHasTag(bool $hasTag): self { $this->options['hasTag'] = $hasTag; return $this; } /** * The start_time * * @param string $startTime The start_time * @return $this Fluent Builder */ public function setStartTime(string $startTime): self { $this->options['startTime'] = $startTime; return $this; } /** * The end_time * * @param string $endTime The end_time * @return $this Fluent Builder */ public function setEndTime(string $endTime): self { $this->options['endTime'] = $endTime; return $this; } /** * The call_type * * @param string $callType The call_type * @return $this Fluent Builder */ public function setCallType(string $callType): self { $this->options['callType'] = $callType; return $this; } /** * The call_state * * @param string $callState The call_state * @return $this Fluent Builder */ public function setCallState(string $callState): self { $this->options['callState'] = $callState; return $this; } /** * The direction * * @param string $direction The direction * @return $this Fluent Builder */ public function setDirection(string $direction): self { $this->options['direction'] = $direction; return $this; } /** * The processing_state * * @param string $processingState The processing_state * @return $this Fluent Builder */ public function setProcessingState(string $processingState): self { $this->options['processingState'] = $processingState; return $this; } /** * The sort_by * * @param string $sortBy The sort_by * @return $this Fluent Builder */ public function setSortBy(string $sortBy): self { $this->options['sortBy'] = $sortBy; return $this; } /** * The subaccount * * @param string $subaccount The subaccount * @return $this Fluent Builder */ public function setSubaccount(string $subaccount): self { $this->options['subaccount'] = $subaccount; return $this; } /** * The abnormal_session * * @param bool $abnormalSession The abnormal_session * @return $this Fluent Builder */ public function setAbnormalSession(bool $abnormalSession): self { $this->options['abnormalSession'] = $abnormalSession; return $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 . ']'; } } Insights/V1/SettingList.php 0000644 00000001577 15107452357 0011627 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1; use Twilio\ListResource; use Twilio\Version; class SettingList extends ListResource { /** * Construct the SettingList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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]'; } } Insights/V1/CallPage.php 0000644 00000002155 15107452357 0011017 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CallPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Insights/V1/ConferenceContext.php 0000644 00000006540 15107452357 0012765 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Insights\V1\Conference\ConferenceParticipantList; use Twilio\Values; use Twilio\Version; /** * @property ConferenceParticipantList $conferenceParticipants * @method \Twilio\Rest\Insights\V1\Conference\ConferenceParticipantContext conferenceParticipants(string $participantSid) */ class ConferenceContext extends InstanceContext { protected $_conferenceParticipants; /** * Initialize the ConferenceContext * * @param Version $version Version that contains the resource * @param string $conferenceSid Conference SID. */ public function __construct(Version $version, $conferenceSid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Insights/V1/Room/ParticipantList.php 0000644 00000011613 15107452357 0013374 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Room; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ParticipantList extends ListResource { /** * Construct the ParticipantList * * @param Version $version Version that contains the resource * @param string $roomSid Unique identifier for the room. */ public function __construct(Version $version, string $roomSid) { parent::__construct($version); // Path Solution $this->solution = ['roomSid' => $roomSid, ]; $this->uri = '/Video/Rooms/' . \rawurlencode($roomSid) . '/Participants'; } /** * Streams ParticipantInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will 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']); } /** * 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); } /** * 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]'; } } Insights/V1/Room/ParticipantInstance.php 0000644 00000011326 15107452357 0014226 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Room; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $participantSid * @property string $participantIdentity * @property \DateTime $joinTime * @property \DateTime $leaveTime * @property string $durationSec * @property string $accountSid * @property string $roomSid * @property string $status * @property string[] $codecs * @property string $endReason * @property int $errorCode * @property string $errorCodeUrl * @property string $mediaRegion * @property array $properties * @property string $edgeLocation * @property array $publisherInfo * @property string $url */ class ParticipantInstance extends InstanceResource { /** * Initialize the ParticipantInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $roomSid Unique identifier for the room. * @param string $participantSid The SID of the Participant resource. */ public function __construct(Version $version, array $payload, string $roomSid, string $participantSid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Insights/V1/Room/ParticipantContext.php 0000644 00000003611 15107452357 0014104 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Room; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ParticipantContext extends InstanceContext { /** * Initialize the ParticipantContext * * @param Version $version Version that contains the resource * @param string $roomSid The SID of the Room resource. * @param string $participantSid The SID of the Participant resource. */ public function __construct(Version $version, $roomSid, $participantSid) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Insights/V1/Room/ParticipantPage.php 0000644 00000002456 15107452357 0013342 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Room; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ParticipantPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Insights/V1/RoomPage.php 0000644 00000002336 15107452357 0011061 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class RoomPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Insights/V1/RoomInstance.php 0000644 00000013441 15107452357 0011750 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Rest\Insights\V1\Room\ParticipantList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $accountSid * @property string $roomSid * @property string $roomName * @property \DateTime $createTime * @property \DateTime $endTime * @property string $roomType * @property string $roomStatus * @property string $statusCallback * @property string $statusCallbackMethod * @property string $createdMethod * @property string $endReason * @property int $maxParticipants * @property int $uniqueParticipants * @property int $uniqueParticipantIdentities * @property int $concurrentParticipants * @property int $maxConcurrentParticipants * @property string[] $codecs * @property string $mediaRegion * @property string $durationSec * @property string $totalParticipantDurationSec * @property string $totalRecordingDurationSec * @property string $processingState * @property bool $recordingEnabled * @property string $edgeLocation * @property string $url * @property array $links */ class RoomInstance extends InstanceResource { protected $_participants; /** * Initialize the RoomInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $roomSid The SID of the Room resource. */ public function __construct(Version $version, array $payload, string $roomSid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Insights/V1/ConferencePage.php 0000644 00000002221 15107452357 0012205 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ConferencePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Insights/V1/ConferenceOptions.php 0000644 00000015644 15107452357 0013001 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1; use Twilio\Options; use Twilio\Values; abstract class ConferenceOptions { /** * @param string $conferenceSid The SID of the conference. * @param string $friendlyName Custom label for the conference. * @param string $status Conference status. * @param string $createdAfter Conferences created after timestamp. * @param string $createdBefore Conferences created before timestamp. * @param string $mixerRegion Region where the conference was mixed. * @param string $tags Tags applied by Twilio for common issues. * @param string $subaccount Account SID for the subaccount. * @param string $detectedIssues Potential issues detected during the * conference. * @param string $endReason Conference end reason. * @return ReadConferenceOptions Options builder */ public static function read(string $conferenceSid = Values::NONE, string $friendlyName = Values::NONE, string $status = Values::NONE, string $createdAfter = Values::NONE, string $createdBefore = Values::NONE, string $mixerRegion = Values::NONE, string $tags = Values::NONE, string $subaccount = Values::NONE, string $detectedIssues = Values::NONE, string $endReason = Values::NONE): ReadConferenceOptions { return new ReadConferenceOptions($conferenceSid, $friendlyName, $status, $createdAfter, $createdBefore, $mixerRegion, $tags, $subaccount, $detectedIssues, $endReason); } } class ReadConferenceOptions extends Options { /** * @param string $conferenceSid The SID of the conference. * @param string $friendlyName Custom label for the conference. * @param string $status Conference status. * @param string $createdAfter Conferences created after timestamp. * @param string $createdBefore Conferences created before timestamp. * @param string $mixerRegion Region where the conference was mixed. * @param string $tags Tags applied by Twilio for common issues. * @param string $subaccount Account SID for the subaccount. * @param string $detectedIssues Potential issues detected during the * conference. * @param string $endReason Conference end reason. */ public function __construct(string $conferenceSid = Values::NONE, string $friendlyName = Values::NONE, string $status = Values::NONE, string $createdAfter = Values::NONE, string $createdBefore = Values::NONE, string $mixerRegion = Values::NONE, string $tags = Values::NONE, string $subaccount = Values::NONE, string $detectedIssues = Values::NONE, string $endReason = Values::NONE) { $this->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. * @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 timestamp. * @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 timestamp. * @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 Region where the conference 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 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. * @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 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. * @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 . ']'; } } Insights/V1/ConferenceList.php 0000644 00000012661 15107452357 0012255 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ConferenceList extends ListResource { /** * Construct the ConferenceList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Conferences'; } /** * 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']); } /** * 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); } /** * Retrieve a single page of ConferenceInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 Conference SID. */ 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]'; } } Insights/V1/ConferenceInstance.php 0000644 00000012621 15107452357 0013102 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Rest\Insights\V1\Conference\ConferenceParticipantList; use Twilio\Values; use Twilio\Version; /** * @property string $conferenceSid * @property string $accountSid * @property string $friendlyName * @property \DateTime $createTime * @property \DateTime $startTime * @property \DateTime $endTime * @property int $durationSeconds * @property int $connectDurationSeconds * @property string $status * @property int $maxParticipants * @property int $maxConcurrentParticipants * @property int $uniqueParticipants * @property string $endReason * @property string $endedBy * @property string $mixerRegion * @property string $mixerRegionRequested * @property bool $recordingEnabled * @property array $detectedIssues * @property string[] $tags * @property array $tagInfo * @property string $processingState * @property string $url * @property array $links */ class ConferenceInstance extends InstanceResource { protected $_conferenceParticipants; /** * Initialize the ConferenceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $conferenceSid Conference SID. */ public function __construct(Version $version, array $payload, string $conferenceSid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Insights/V1/Call/EventList.php 0000644 00000011664 15107452357 0012144 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Call; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class EventList extends ListResource { /** * Construct the EventList * * @param Version $version Version that contains the resource * @param string $callSid The call_sid */ public function __construct(Version $version, string $callSid) { parent::__construct($version); // Path Solution $this->solution = ['callSid' => $callSid, ]; $this->uri = '/Voice/' . \rawurlencode($callSid) . '/Events'; } /** * Streams EventInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of EventInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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]'; } } Insights/V1/Call/AnnotationContext.php 0000644 00000005103 15107452357 0013675 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Call; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class AnnotationContext extends InstanceContext { /** * Initialize the AnnotationContext * * @param Version $version Version that contains the resource * @param string $callSid Call SID. */ public function __construct(Version $version, $callSid) { parent::__construct($version); // Path Solution $this->solution = ['callSid' => $callSid, ]; $this->uri = '/Voice/' . \rawurlencode($callSid) . '/Annotation'; } /** * 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new AnnotationInstance($this->version, $payload, $this->solution['callSid']); } /** * Fetch the AnnotationInstance * * @return AnnotationInstance Fetched AnnotationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AnnotationInstance { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Insights/V1/Call/AnnotationList.php 0000644 00000002163 15107452357 0013167 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Call; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class AnnotationList extends ListResource { /** * Construct the AnnotationList * * @param Version $version Version that contains the resource * @param string $callSid Call SID. */ public function __construct(Version $version, string $callSid) { parent::__construct($version); // Path Solution $this->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]'; } } Insights/V1/Call/CallSummaryList.php 0000644 00000002013 15107452357 0013300 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Call; use Twilio\ListResource; use Twilio\Version; class CallSummaryList extends ListResource { /** * Construct the CallSummaryList * * @param Version $version Version that contains the resource * @param string $callSid The call_sid */ public function __construct(Version $version, string $callSid) { parent::__construct($version); // Path Solution $this->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]'; } } Insights/V1/Call/CallSummaryContext.php 0000644 00000003337 15107452357 0014023 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Call; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class CallSummaryContext extends InstanceContext { /** * Initialize the CallSummaryContext * * @param Version $version Version that contains the resource * @param string $callSid The call_sid */ public function __construct(Version $version, $callSid) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->fetch('GET', $this->uri, $params); return new CallSummaryInstance($this->version, $payload, $this->solution['callSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Insights.V1.CallSummaryContext ' . \implode(' ', $context) . ']'; } } Insights/V1/Call/EventPage.php 0000644 00000002544 15107452357 0012102 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Call; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class EventPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Insights/V1/Call/CallSummaryPage.php 0000644 00000002275 15107452357 0013253 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Call; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CallSummaryPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Insights/V1/Call/AnnotationInstance.php 0000644 00000007665 15107452357 0014034 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Call; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $callSid * @property string $accountSid * @property string $answeredBy * @property string $connectivityIssue * @property string[] $qualityIssues * @property bool $spam * @property int $callScore * @property string $comment * @property string $incident * @property string $url */ class AnnotationInstance extends InstanceResource { /** * Initialize the AnnotationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $callSid Call SID. */ public function __construct(Version $version, array $payload, string $callSid) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * Fetch the AnnotationInstance * * @return AnnotationInstance Fetched AnnotationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AnnotationInstance { 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.AnnotationInstance ' . \implode(' ', $context) . ']'; } } Insights/V1/Call/CallSummaryInstance.php 0000644 00000011621 15107452357 0014136 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Call; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $callSid * @property string $callType * @property string $callState * @property string $answeredBy * @property string $processingState * @property \DateTime $createdTime * @property \DateTime $startTime * @property \DateTime $endTime * @property int $duration * @property int $connectDuration * @property array $from * @property array $to * @property array $carrierEdge * @property array $clientEdge * @property array $sdkEdge * @property array $sipEdge * @property string[] $tags * @property string $url * @property array $attributes * @property array $properties * @property array $trust * @property array $annotation */ class CallSummaryInstance extends InstanceResource { /** * Initialize the CallSummaryInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $callSid The call_sid */ public function __construct(Version $version, array $payload, string $callSid) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Insights/V1/Call/MetricList.php 0000644 00000011767 15107452357 0012312 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Call; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class MetricList extends ListResource { /** * Construct the MetricList * * @param Version $version Version that contains the resource * @param string $callSid The call_sid */ public function __construct(Version $version, string $callSid) { parent::__construct($version); // Path Solution $this->solution = ['callSid' => $callSid, ]; $this->uri = '/Voice/' . \rawurlencode($callSid) . '/Metrics'; } /** * Streams MetricInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of MetricInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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]'; } } Insights/V1/Call/CallSummaryOptions.php 0000644 00000002631 15107452357 0014026 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Call; use Twilio\Options; use Twilio\Values; abstract class CallSummaryOptions { /** * @param string $processingState The processing_state * @return FetchCallSummaryOptions Options builder */ public static function fetch(string $processingState = Values::NONE): FetchCallSummaryOptions { return new FetchCallSummaryOptions($processingState); } } class FetchCallSummaryOptions extends Options { /** * @param string $processingState The processing_state */ public function __construct(string $processingState = Values::NONE) { $this->options['processingState'] = $processingState; } /** * The processing_state * * @param string $processingState The processing_state * @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 . ']'; } } Insights/V1/Call/MetricPage.php 0000644 00000002552 15107452357 0012243 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Call; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class MetricPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Insights/V1/Call/AnnotationPage.php 0000644 00000002450 15107452357 0013127 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Call; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class AnnotationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Insights/V1/Call/EventOptions.php 0000644 00000002606 15107452357 0012660 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Call; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class EventOptions { /** * @param string $edge The edge * @return ReadEventOptions Options builder */ public static function read(string $edge = Values::NONE): ReadEventOptions { return new ReadEventOptions($edge); } } class ReadEventOptions extends Options { /** * @param string $edge The edge */ public function __construct(string $edge = Values::NONE) { $this->options['edge'] = $edge; } /** * The edge * * @param string $edge The 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 . ']'; } } Insights/V1/Call/AnnotationOptions.php 0000644 00000014701 15107452357 0013710 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Call; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ abstract class AnnotationOptions { /** * @param string $answeredBy Indicates the answering entity as determined by * Answering Machine Detection. * @param string $connectivityIssue Indicates if the call had any connectivity * issue * @param string $qualityIssues Indicates if the call had audio quality issues. * @param bool $spam Call spam indicator * @param int $callScore Call Score * @param string $comment User comments * @param string $incident Call tag for incidents or support ticket * @return UpdateAnnotationOptions Options builder */ public static function update(string $answeredBy = Values::NONE, string $connectivityIssue = Values::NONE, string $qualityIssues = Values::NONE, bool $spam = Values::NONE, int $callScore = Values::NONE, string $comment = Values::NONE, string $incident = Values::NONE): UpdateAnnotationOptions { return new UpdateAnnotationOptions($answeredBy, $connectivityIssue, $qualityIssues, $spam, $callScore, $comment, $incident); } } class UpdateAnnotationOptions extends Options { /** * @param string $answeredBy Indicates the answering entity as determined by * Answering Machine Detection. * @param string $connectivityIssue Indicates if the call had any connectivity * issue * @param string $qualityIssues Indicates if the call had audio quality issues. * @param bool $spam Call spam indicator * @param int $callScore Call Score * @param string $comment User comments * @param string $incident Call tag for incidents or support ticket */ public function __construct(string $answeredBy = Values::NONE, string $connectivityIssue = Values::NONE, string $qualityIssues = Values::NONE, bool $spam = Values::NONE, int $callScore = Values::NONE, string $comment = Values::NONE, string $incident = Values::NONE) { $this->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; } /** * Which entity answered the call as determined by Answering Machine Detection. Use this to provide feedback on Answering Machine Detection accuracy. Possible enumerated values, one of: human, machine. human indicates the call was answered by a person. machine indicates the call was answered by an answering machine. * * @param string $answeredBy Indicates the answering entity as determined by * Answering Machine Detection. * @return $this Fluent Builder */ public function setAnsweredBy(string $answeredBy): self { $this->options['answeredBy'] = $answeredBy; return $this; } /** * Specify if the call had any connectivity issues. Possible enumerated values, one : no_connectivity_issue, invalid_number, caller_id, dropped_call, number_reachability. * * @param string $connectivityIssue Indicates if the call had any connectivity * issue * @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 Indicates if the call had audio quality issues. * @return $this Fluent Builder */ public function setQualityIssues(string $qualityIssues): self { $this->options['qualityIssues'] = $qualityIssues; return $this; } /** * Specify 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. Is of type Boolean: true, false. Use true if the call was a spam call. * * @param bool $spam Call spam indicator * @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 Call Score * @return $this Fluent Builder */ public function setCallScore(int $callScore): self { $this->options['callScore'] = $callScore; return $this; } /** * Specify any comments pertaining to the call. This of type string with a max limit of 100 characters. Twilio does not treat this field as PII, so don’t put any PII in here. * * @param string $comment User comments * @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. This is of type string with a max limit of 100 characters. Twilio does not treat this field as PII, so don’t put any PII in here. * * @param string $incident Call tag for incidents or support ticket * @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 . ']'; } } Insights/V1/Call/MetricOptions.php 0000644 00000003563 15107452357 0013025 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Call; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class MetricOptions { /** * @param string $edge The edge * @param string $direction The direction * @return ReadMetricOptions Options builder */ public static function read(string $edge = Values::NONE, string $direction = Values::NONE): ReadMetricOptions { return new ReadMetricOptions($edge, $direction); } } class ReadMetricOptions extends Options { /** * @param string $edge The edge * @param string $direction The direction */ public function __construct(string $edge = Values::NONE, string $direction = Values::NONE) { $this->options['edge'] = $edge; $this->options['direction'] = $direction; } /** * The edge * * @param string $edge The edge * @return $this Fluent Builder */ public function setEdge(string $edge): self { $this->options['edge'] = $edge; return $this; } /** * The direction * * @param string $direction The 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.Insights.V1.ReadMetricOptions ' . $options . ']'; } } Insights/V1/Call/EventInstance.php 0000644 00000005435 15107452357 0012774 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Call; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $timestamp * @property string $callSid * @property string $accountSid * @property string $edge * @property string $group * @property string $level * @property string $name * @property array $carrierEdge * @property array $sipEdge * @property array $sdkEdge * @property array $clientEdge */ class EventInstance extends InstanceResource { /** * Initialize the EventInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $callSid The call_sid */ public function __construct(Version $version, array $payload, string $callSid) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Insights/V1/Call/MetricInstance.php 0000644 00000005177 15107452357 0013141 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Call; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $timestamp * @property string $callSid * @property string $accountSid * @property string $edge * @property string $direction * @property array $carrierEdge * @property array $sipEdge * @property array $sdkEdge * @property array $clientEdge */ class MetricInstance extends InstanceResource { /** * Initialize the MetricInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $callSid The call_sid */ public function __construct(Version $version, array $payload, string $callSid) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Insights/V1/CallSummariesInstance.php 0000644 00000007324 15107452357 0013600 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $callSid * @property string $answeredBy * @property string $callType * @property string $callState * @property string $processingState * @property \DateTime $createdTime * @property \DateTime $startTime * @property \DateTime $endTime * @property int $duration * @property int $connectDuration * @property array $from * @property array $to * @property array $carrierEdge * @property array $clientEdge * @property array $sdkEdge * @property array $sipEdge * @property string[] $tags * @property string $url * @property array $attributes * @property array $properties * @property array $trust */ class CallSummariesInstance extends InstanceResource { /** * Initialize the CallSummariesInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->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'), ]; $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]'; } } Insights/V1/CallSummariesList.php 0000644 00000013344 15107452357 0012746 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class CallSummariesList extends ListResource { /** * Construct the CallSummariesList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Voice/Summaries'; } /** * 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']); } /** * 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); } /** * Retrieve a single page of CallSummariesInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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']), '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]'; } } Insights/V1/SettingPage.php 0000644 00000002177 15107452357 0011565 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SettingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Insights/V1/SettingContext.php 0000644 00000004464 15107452357 0012336 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class SettingContext extends InstanceContext { /** * Initialize the SettingContext * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->fetch('GET', $this->uri, $params); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } Insights/V1/SettingInstance.php 0000644 00000006261 15107452357 0012453 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property bool $advancedFeatures * @property bool $voiceTrace * @property string $url */ class SettingInstance extends InstanceResource { /** * Initialize the SettingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Insights/V1/SettingOptions.php 0000644 00000007033 15107452357 0012340 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1; use Twilio\Options; use Twilio\Values; abstract class SettingOptions { /** * @param string $subaccountSid The subaccount_sid * @return FetchSettingOptions Options builder */ public static function fetch(string $subaccountSid = Values::NONE): FetchSettingOptions { return new FetchSettingOptions($subaccountSid); } /** * @param bool $advancedFeatures The advanced_features * @param bool $voiceTrace The voice_trace * @param string $subaccountSid The subaccount_sid * @return UpdateSettingOptions Options builder */ public static function update(bool $advancedFeatures = Values::NONE, bool $voiceTrace = Values::NONE, string $subaccountSid = Values::NONE): UpdateSettingOptions { return new UpdateSettingOptions($advancedFeatures, $voiceTrace, $subaccountSid); } } class FetchSettingOptions extends Options { /** * @param string $subaccountSid The subaccount_sid */ public function __construct(string $subaccountSid = Values::NONE) { $this->options['subaccountSid'] = $subaccountSid; } /** * The subaccount_sid * * @param string $subaccountSid The subaccount_sid * @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 The advanced_features * @param bool $voiceTrace The voice_trace * @param string $subaccountSid The subaccount_sid */ public function __construct(bool $advancedFeatures = Values::NONE, bool $voiceTrace = Values::NONE, string $subaccountSid = Values::NONE) { $this->options['advancedFeatures'] = $advancedFeatures; $this->options['voiceTrace'] = $voiceTrace; $this->options['subaccountSid'] = $subaccountSid; } /** * The advanced_features * * @param bool $advancedFeatures The advanced_features * @return $this Fluent Builder */ public function setAdvancedFeatures(bool $advancedFeatures): self { $this->options['advancedFeatures'] = $advancedFeatures; return $this; } /** * The voice_trace * * @param bool $voiceTrace The voice_trace * @return $this Fluent Builder */ public function setVoiceTrace(bool $voiceTrace): self { $this->options['voiceTrace'] = $voiceTrace; return $this; } /** * The subaccount_sid * * @param string $subaccountSid The subaccount_sid * @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 . ']'; } } Insights/V1/CallInstance.php 0000644 00000007005 15107452357 0011706 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Rest\Insights\V1\Call\AnnotationList; use Twilio\Rest\Insights\V1\Call\CallSummaryList; use Twilio\Rest\Insights\V1\Call\EventList; use Twilio\Rest\Insights\V1\Call\MetricList; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $url * @property array $links */ class CallInstance extends InstanceResource { protected $_events; protected $_metrics; protected $_summary; protected $_annotation; /** * Initialize the CallInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The sid */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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 events */ protected function getEvents(): EventList { return $this->proxy()->events; } /** * Access the metrics */ protected function getMetrics(): MetricList { return $this->proxy()->metrics; } /** * 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) . ']'; } } Insights/V1.php 0000644 00000006754 15107452357 0007360 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Insights\V1\CallList; use Twilio\Rest\Insights\V1\CallSummariesList; use Twilio\Rest\Insights\V1\ConferenceList; use Twilio\Rest\Insights\V1\RoomList; use Twilio\Rest\Insights\V1\SettingList; use Twilio\Version; /** * @property SettingList $settings * @property CallList $calls * @property CallSummariesList $callSummaries * @property ConferenceList $conferences * @property RoomList $rooms * @method \Twilio\Rest\Insights\V1\CallContext calls(string $sid) * @method \Twilio\Rest\Insights\V1\ConferenceContext conferences(string $conferenceSid) * @method \Twilio\Rest\Insights\V1\RoomContext rooms(string $roomSid) */ class V1 extends Version { protected $_settings; protected $_calls; protected $_callSummaries; protected $_conferences; protected $_rooms; /** * Construct the V1 version of Insights * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } protected function getSettings(): SettingList { if (!$this->_settings) { $this->_settings = new SettingList($this); } return $this->_settings; } 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; } /** * 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]'; } } Chat/V1/CredentialPage.php 0000644 00000002205 15107452357 0011301 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CredentialPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Chat/V1/CredentialOptions.php 0000644 00000027244 15107452357 0012072 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1; use Twilio\Options; use Twilio\Values; abstract class CredentialOptions { /** * @param string $friendlyName A string to describe the resource * @param string $certificate [APN only] The URL encoded representation of the * certificate * @param string $privateKey [APN only] The URL encoded representation of the * private key * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @param string $apiKey [GCM only] The API key for the project that was * obtained from the Google Developer console for your * GCM Service application credential * @param string $secret [FCM only] The Server key of your project from * Firebase console * @return CreateCredentialOptions Options builder */ public static function create(string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::NONE, string $apiKey = Values::NONE, string $secret = Values::NONE): CreateCredentialOptions { return new CreateCredentialOptions($friendlyName, $certificate, $privateKey, $sandbox, $apiKey, $secret); } /** * @param string $friendlyName A string to describe the resource * @param string $certificate [APN only] The URL encoded representation of the * certificate * @param string $privateKey [APN only] The URL encoded representation of the * private key * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @param string $apiKey [GCM only] The API key for the project that was * obtained from the Google Developer console for your * GCM Service application credential * @param string $secret [FCM only] The Server key of your project from * Firebase console * @return UpdateCredentialOptions Options builder */ public static function update(string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::NONE, string $apiKey = Values::NONE, string $secret = Values::NONE): UpdateCredentialOptions { return new UpdateCredentialOptions($friendlyName, $certificate, $privateKey, $sandbox, $apiKey, $secret); } } class CreateCredentialOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $certificate [APN only] The URL encoded representation of the * certificate * @param string $privateKey [APN only] The URL encoded representation of the * private key * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @param string $apiKey [GCM only] The API key for the project that was * obtained from the Google Developer console for your * GCM Service application credential * @param string $secret [FCM only] The Server key of your project from * Firebase console */ public function __construct(string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::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 new resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName(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 * @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 * @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 * @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 * Firebase console * @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 string to describe the resource * @param string $certificate [APN only] The URL encoded representation of the * certificate * @param string $privateKey [APN only] The URL encoded representation of the * private key * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @param string $apiKey [GCM only] The API key for the project that was * obtained from the Google Developer console for your * GCM Service application credential * @param string $secret [FCM only] The Server key of your project from * Firebase console */ public function __construct(string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::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 string to describe the resource * @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 * @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 * @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 * @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 * Firebase console * @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 . ']'; } } Chat/V1/Service/UserInstance.php 0000644 00000012012 15107452357 0012432 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Chat\V1\Service\User\UserChannelList; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $attributes * @property string $friendlyName * @property string $roleSid * @property string $identity * @property bool $isOnline * @property bool $isNotifiable * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property int $joinedChannelsCount * @property array $links * @property string $url */ class UserInstance extends InstanceResource { protected $_userChannels; /** * Initialize the UserInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the UserInstance * * @return UserInstance Fetched UserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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) . ']'; } } Chat/V1/Service/UserOptions.php 0000644 00000012716 15107452357 0012334 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Options; use Twilio\Values; abstract class UserOptions { /** * @param string $roleSid The SID of the Role assigned to this user * @param string $attributes A valid JSON string that contains * application-specific data * @param string $friendlyName A string to describe the new resource * @return CreateUserOptions Options builder */ public static function create(string $roleSid = Values::NONE, string $attributes = Values::NONE, string $friendlyName = Values::NONE): CreateUserOptions { return new CreateUserOptions($roleSid, $attributes, $friendlyName); } /** * @param string $roleSid The SID id of the Role assigned to this user * @param string $attributes A valid JSON string that contains * application-specific data * @param string $friendlyName A string to describe the resource * @return UpdateUserOptions Options builder */ public static function update(string $roleSid = Values::NONE, string $attributes = Values::NONE, string $friendlyName = Values::NONE): UpdateUserOptions { return new UpdateUserOptions($roleSid, $attributes, $friendlyName); } } class CreateUserOptions extends Options { /** * @param string $roleSid The SID of the Role assigned to this user * @param string $attributes A valid JSON string that contains * application-specific data * @param string $friendlyName A string to describe the new resource */ public function __construct(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 the new User. * * @param string $roleSid The SID of the Role 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 new resource. This value is often used for display purposes. * * @param string $friendlyName A string to describe the new resource * @return $this Fluent Builder */ public function setFriendlyName(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 id of the Role assigned to this user * @param string $attributes A valid JSON string that contains * application-specific data * @param string $friendlyName A string to describe the resource */ public function __construct(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 id of the Role 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 string to describe the resource * @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 . ']'; } } Chat/V1/Service/ChannelOptions.php 0000644 00000017535 15107452357 0012772 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Options; use Twilio\Values; abstract class ChannelOptions { /** * @param string $friendlyName A string to describe the new resource * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $attributes A valid JSON string that contains * application-specific data * @param string $type The visibility of the channel * @return CreateChannelOptions Options builder */ public static function create(string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, string $attributes = Values::NONE, string $type = Values::NONE): CreateChannelOptions { return new CreateChannelOptions($friendlyName, $uniqueName, $attributes, $type); } /** * @param string[] $type The visibility of the channel to read * @return ReadChannelOptions Options builder */ public static function read(array $type = Values::ARRAY_NONE): ReadChannelOptions { return new ReadChannelOptions($type); } /** * @param string $friendlyName A string to describe the resource * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $attributes A valid JSON string that contains * application-specific data * @return UpdateChannelOptions Options builder */ public static function update(string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, string $attributes = Values::NONE): UpdateChannelOptions { return new UpdateChannelOptions($friendlyName, $uniqueName, $attributes); } } class CreateChannelOptions extends Options { /** * @param string $friendlyName A string to describe the new resource * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $attributes A valid JSON string that contains * application-specific data * @param string $type The visibility of the channel */ public function __construct(string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, string $attributes = Values::NONE, string $type = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['attributes'] = $attributes; $this->options['type'] = $type; } /** * A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the new resource * @return $this Fluent Builder */ public function setFriendlyName(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 * @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 visibility of the channel. Can be: `public` or `private` and defaults to `public`. * * @param string $type The visibility of the channel * @return $this Fluent Builder */ public function setType(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 channel to read */ 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 channel to read * @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 string to describe the resource * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $attributes A valid JSON string that contains * application-specific data */ public function __construct(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 string to describe the resource * @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 * @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 . ']'; } } Chat/V1/Service/ChannelPage.php 0000644 00000002242 15107452357 0012200 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ChannelPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Chat/V1/Service/ChannelList.php 0000644 00000013742 15107452357 0012246 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ChannelList extends ListResource { /** * Construct the ChannelList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with */ public function __construct(Version $version, string $serviceSid) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ChannelInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams ChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of ChannelInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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' => Serialize::map($options['type'], function($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ChannelPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ChannelInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return 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 unique string that identifies the resource */ 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]'; } } Chat/V1/Service/Channel/MemberOptions.php 0000644 00000012361 15107452357 0014171 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class MemberOptions { /** * @param string $roleSid The SID of the Role to assign to the member * @return CreateMemberOptions Options builder */ public static function create(string $roleSid = Values::NONE): CreateMemberOptions { return new CreateMemberOptions($roleSid); } /** * @param string[] $identity The `identity` value of the resources to read * @return ReadMemberOptions Options builder */ public static function read(array $identity = Values::ARRAY_NONE): ReadMemberOptions { return new ReadMemberOptions($identity); } /** * @param string $roleSid The SID of the Role to assign to the member * @param int $lastConsumedMessageIndex The index of the last consumed Message * for the Channel for the Member * @return UpdateMemberOptions Options builder */ public static function update(string $roleSid = Values::NONE, int $lastConsumedMessageIndex = Values::NONE): UpdateMemberOptions { return new UpdateMemberOptions($roleSid, $lastConsumedMessageIndex); } } class CreateMemberOptions extends Options { /** * @param string $roleSid The SID of the Role to assign to the member */ public function __construct(string $roleSid = Values::NONE) { $this->options['roleSid'] = $roleSid; } /** * The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/api/services). * * @param string $roleSid The SID of the Role to assign to the member * @return $this Fluent Builder */ public function setRoleSid(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 `identity` value of the resources to read */ 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 `identity` value of the resources to read * @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 to assign to the member * @param int $lastConsumedMessageIndex The index of the last consumed Message * for the Channel for the Member */ public function __construct(string $roleSid = Values::NONE, int $lastConsumedMessageIndex = Values::NONE) { $this->options['roleSid'] = $roleSid; $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; } /** * The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/api/services). * * @param string $roleSid The SID of the Role to assign to the member * @return $this Fluent Builder */ public function setRoleSid(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 consumed Message * for the Channel for the Member * @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 . ']'; } } Chat/V1/Service/Channel/MemberContext.php 0000644 00000005770 15107452357 0014170 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class MemberContext extends InstanceContext { /** * Initialize the MemberContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $channelSid The unique ID of the channel the member belongs to * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $serviceSid, $channelSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Members/' . \rawurlencode($sid) . ''; } /** * Fetch the MemberInstance * * @return MemberInstance Fetched MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MemberInstance { $payload = $this->version->fetch('GET', $this->uri); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Delete the MemberInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the MemberInstance * * @param array|Options $options Optional Arguments * @return MemberInstance Updated MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MemberInstance { $options = new Values($options); $data = Values::of([ 'RoleSid' => $options['roleSid'], 'LastConsumedMessageIndex' => $options['lastConsumedMessageIndex'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.MemberContext ' . \implode(' ', $context) . ']'; } } Chat/V1/Service/Channel/MessageOptions.php 0000644 00000012550 15107452360 0014340 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class MessageOptions { /** * @param string $from The identity of the new message's author * @param string $attributes A valid JSON string that contains * application-specific data * @return CreateMessageOptions Options builder */ public static function create(string $from = Values::NONE, string $attributes = Values::NONE): CreateMessageOptions { return new CreateMessageOptions($from, $attributes); } /** * @param string $order The sort order of the returned messages * @return ReadMessageOptions Options builder */ public static function read(string $order = Values::NONE): ReadMessageOptions { return new ReadMessageOptions($order); } /** * @param string $body The message to send to the channel * @param string $attributes A valid JSON string that contains * application-specific data * @return UpdateMessageOptions Options builder */ public static function update(string $body = Values::NONE, string $attributes = Values::NONE): UpdateMessageOptions { return new UpdateMessageOptions($body, $attributes); } } class CreateMessageOptions extends Options { /** * @param string $from The identity of the new message's author * @param string $attributes A valid JSON string that contains * application-specific data */ public function __construct(string $from = Values::NONE, string $attributes = Values::NONE) { $this->options['from'] = $from; $this->options['attributes'] = $attributes; } /** * The [identity](https://www.twilio.com/docs/api/chat/guides/identity) of the new message's author. The default value is `system`. * * @param string $from The identity of the new message's author * @return $this Fluent Builder */ public function setFrom(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 */ 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 * @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 * @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 * @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 . ']'; } } Chat/V1/Service/Channel/InviteInstance.php 0000644 00000010406 15107452360 0014321 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $channelSid * @property string $serviceSid * @property string $identity * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $roleSid * @property string $createdBy * @property string $url */ class InviteInstance extends InstanceResource { /** * Initialize the InviteInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $channelSid The SID of the Channel the new resource belongs to * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $serviceSid, string $channelSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the InviteInstance * * @return InviteInstance Fetched InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): InviteInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Chat/V1/Service/Channel/MessagePage.php 0000644 00000002413 15107452360 0013556 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MessagePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Chat/V1/Service/Channel/MessageList.php 0000644 00000014464 15107452360 0013626 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class MessageList extends ListResource { /** * Construct the MessageList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $channelSid The unique ID of the Channel the Message resource * belongs to */ public function __construct(Version $version, string $serviceSid, string $channelSid) { parent::__construct($version); // Path Solution $this->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 * @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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Streams MessageInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of MessageInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 unique string that identifies the resource */ 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]'; } } Chat/V1/Service/Channel/MemberList.php 0000644 00000014454 15107452360 0013450 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class MemberList extends ListResource { /** * Construct the MemberList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $channelSid The unique ID of the Channel for the member */ public function __construct(Version $version, string $serviceSid, string $channelSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Members'; } /** * Create the MemberInstance * * @param string $identity The `identity` value that identifies the new * resource's User * @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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Streams MemberInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of MemberInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 unique string that identifies the resource */ 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]'; } } Chat/V1/Service/Channel/MemberInstance.php 0000644 00000011505 15107452360 0014273 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $channelSid * @property string $serviceSid * @property string $identity * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $roleSid * @property int $lastConsumedMessageIndex * @property \DateTime $lastConsumptionTimestamp * @property string $url */ class MemberInstance extends InstanceResource { /** * Initialize the MemberInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $channelSid The unique ID of the Channel for the member * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $serviceSid, string $channelSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the MemberInstance * * @return MemberInstance Fetched MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MemberInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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) . ']'; } } Chat/V1/Service/Channel/MemberPage.php 0000644 00000002405 15107452360 0013402 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MemberPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Chat/V1/Service/Channel/MessageContext.php 0000644 00000005757 15107452360 0014344 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class MessageContext extends InstanceContext { /** * Initialize the MessageContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $channelSid The unique ID of the Channel the message to fetch * belongs to * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $serviceSid, $channelSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Messages/' . \rawurlencode($sid) . ''; } /** * Fetch the MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MessageInstance { $payload = $this->version->fetch('GET', $this->uri); return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Delete the MessageInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MessageInstance { $options = new Values($options); $data = Values::of(['Body' => $options['body'], 'Attributes' => $options['attributes'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.MessageContext ' . \implode(' ', $context) . ']'; } } Chat/V1/Service/Channel/MessageInstance.php 0000644 00000011641 15107452360 0014451 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $attributes * @property string $serviceSid * @property string $to * @property string $channelSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property bool $wasEdited * @property string $from * @property string $body * @property int $index * @property string $url */ class MessageInstance extends InstanceResource { /** * Initialize the MessageInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $channelSid The unique ID of the Channel the Message resource * belongs to * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $serviceSid, string $channelSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MessageInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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) . ']'; } } Chat/V1/Service/Channel/InviteOptions.php 0000644 00000005350 15107452360 0014212 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class InviteOptions { /** * @param string $roleSid The Role assigned to the new member * @return CreateInviteOptions Options builder */ public static function create(string $roleSid = Values::NONE): CreateInviteOptions { return new CreateInviteOptions($roleSid); } /** * @param string[] $identity The `identity` value of the resources to read * @return ReadInviteOptions Options builder */ public static function read(array $identity = Values::ARRAY_NONE): ReadInviteOptions { return new ReadInviteOptions($identity); } } class CreateInviteOptions extends Options { /** * @param string $roleSid The Role assigned to the new member */ public function __construct(string $roleSid = Values::NONE) { $this->options['roleSid'] = $roleSid; } /** * The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to the new member. * * @param string $roleSid The Role assigned to the new member * @return $this Fluent Builder */ public function setRoleSid(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 `identity` value of the resources to read */ 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 `identity` value of the resources to read * @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 . ']'; } } Chat/V1/Service/Channel/InviteList.php 0000644 00000014463 15107452360 0013477 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class InviteList extends ListResource { /** * Construct the InviteList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $channelSid The SID of the Channel the new resource belongs to */ public function __construct(Version $version, string $serviceSid, string $channelSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Invites'; } /** * Create the InviteInstance * * @param string $identity The `identity` value that identifies the new * resource's User * @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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new InviteInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Streams InviteInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of InviteInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 unique string that identifies the resource */ 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]'; } } Chat/V1/Service/Channel/InvitePage.php 0000644 00000002405 15107452360 0013431 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class InvitePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Chat/V1/Service/Channel/InviteContext.php 0000644 00000004354 15107452360 0014206 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class InviteContext extends InstanceContext { /** * Initialize the InviteContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $channelSid The SID of the Channel the resource to fetch * belongs to * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $serviceSid, $channelSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Invites/' . \rawurlencode($sid) . ''; } /** * Fetch the InviteInstance * * @return InviteInstance Fetched InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): InviteInstance { $payload = $this->version->fetch('GET', $this->uri); return new InviteInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Delete the InviteInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Chat/V1/Service/UserContext.php 0000644 00000010570 15107452360 0012313 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Chat\V1\Service\User\UserChannelList; use Twilio\Values; use Twilio\Version; /** * @property UserChannelList $userChannels */ class UserContext extends InstanceContext { protected $_userChannels; /** * Initialize the UserContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Users/' . \rawurlencode($sid) . ''; } /** * Fetch the UserInstance * * @return UserInstance Fetched UserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserInstance { $payload = $this->version->fetch('GET', $this->uri); return new UserInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Delete the UserInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserInstance { $options = new Values($options); $data = Values::of([ 'RoleSid' => $options['roleSid'], 'Attributes' => $options['attributes'], 'FriendlyName' => $options['friendlyName'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } Chat/V1/Service/User/UserChannelPage.php 0000644 00000002432 15107452360 0013750 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\User; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UserChannelPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Chat/V1/Service/User/UserChannelInstance.php 0000644 00000005211 15107452360 0014636 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\User; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $serviceSid * @property string $channelSid * @property string $memberSid * @property string $status * @property int $lastConsumedMessageIndex * @property int $unreadMessagesCount * @property array $links */ class UserChannelInstance extends InstanceResource { /** * Initialize the UserChannelInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $userSid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $serviceSid, string $userSid) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Chat/V1/Service/User/UserChannelList.php 0000644 00000011272 15107452360 0014011 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\User; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class UserChannelList extends ListResource { /** * Construct the UserChannelList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $userSid The unique string that identifies the resource */ public function __construct(Version $version, string $serviceSid, string $userSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'userSid' => $userSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Users/' . \rawurlencode($userSid) . '/Channels'; } /** * Streams UserChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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]'; } } Chat/V1/Service/ChannelInstance.php 0000644 00000012703 15107452360 0013065 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Chat\V1\Service\Channel\InviteList; use Twilio\Rest\Chat\V1\Service\Channel\MemberList; use Twilio\Rest\Chat\V1\Service\Channel\MessageList; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $friendlyName * @property string $uniqueName * @property string $attributes * @property string $type * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $createdBy * @property int $membersCount * @property int $messagesCount * @property string $url * @property array $links */ class ChannelInstance extends InstanceResource { protected $_members; protected $_messages; protected $_invites; /** * Initialize the ChannelInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the ChannelInstance * * @return ChannelInstance Fetched ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ChannelInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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 messages */ protected function getMessages(): MessageList { return $this->proxy()->messages; } /** * Access the invites */ protected function getInvites(): InviteList { 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.Chat.V1.ChannelInstance ' . \implode(' ', $context) . ']'; } } Chat/V1/Service/ChannelContext.php 0000644 00000013033 15107452360 0012742 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Chat\V1\Service\Channel\InviteList; use Twilio\Rest\Chat\V1\Service\Channel\MemberList; use Twilio\Rest\Chat\V1\Service\Channel\MessageList; use Twilio\Values; use Twilio\Version; /** * @property MemberList $members * @property MessageList $messages * @property InviteList $invites * @method \Twilio\Rest\Chat\V1\Service\Channel\MemberContext members(string $sid) * @method \Twilio\Rest\Chat\V1\Service\Channel\MessageContext messages(string $sid) * @method \Twilio\Rest\Chat\V1\Service\Channel\InviteContext invites(string $sid) */ class ChannelContext extends InstanceContext { protected $_members; protected $_messages; protected $_invites; /** * Initialize the ChannelContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($sid) . ''; } /** * Fetch the ChannelInstance * * @return ChannelInstance Fetched ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ChannelInstance { $payload = $this->version->fetch('GET', $this->uri); return new ChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Delete the ChannelInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Updated ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ChannelInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'Attributes' => $options['attributes'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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 messages */ protected function getMessages(): MessageList { if (!$this->_messages) { $this->_messages = new MessageList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_messages; } /** * 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; } /** * 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) . ']'; } } Chat/V1/Service/UserPage.php 0000644 00000002220 15107452360 0011534 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UserPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Chat/V1/Service/RolePage.php 0000644 00000002220 15107452360 0011517 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RolePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Chat/V1/Service/RoleList.php 0000644 00000013056 15107452360 0011567 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class RoleList extends ListResource { /** * Construct the RoleList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with */ public function __construct(Version $version, string $serviceSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Roles'; } /** * Create the RoleInstance * * @param string $friendlyName A string to describe the new resource * @param string $type The type of role * @param string[] $permission A permission the role should have * @return RoleInstance 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; }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new RoleInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams RoleInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 unique string that identifies the resource */ 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]'; } } Chat/V1/Service/UserList.php 0000644 00000013136 15107452360 0011603 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class UserList extends ListResource { /** * Construct the UserList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with */ public function __construct(Version $version, string $serviceSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Users'; } /** * Create the UserInstance * * @param string $identity The `identity` value that identifies the new * resource's User * @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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new UserInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams UserInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 unique string that identifies the resource */ 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]'; } } Chat/V1/Service/RoleContext.php 0000644 00000005170 15107452360 0012276 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class RoleContext extends InstanceContext { /** * Initialize the RoleContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Roles/' . \rawurlencode($sid) . ''; } /** * Fetch the RoleInstance * * @return RoleInstance Fetched RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RoleInstance { $payload = $this->version->fetch('GET', $this->uri); return new RoleInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Delete the RoleInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the RoleInstance * * @param string[] $permission A permission the role should have * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $permission): RoleInstance { $data = Values::of(['Permission' => Serialize::map($permission, function($e) { return $e; }), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new RoleInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.RoleContext ' . \implode(' ', $context) . ']'; } } Chat/V1/Service/RoleInstance.php 0000644 00000010406 15107452360 0012414 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $friendlyName * @property string $type * @property string[] $permissions * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class RoleInstance extends InstanceResource { /** * Initialize the RoleInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the RoleInstance * * @return RoleInstance Fetched RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RoleInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Update the RoleInstance * * @param string[] $permission A permission the role should have * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(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) . ']'; } } Chat/V1/ServiceInstance.php 0000644 00000014175 15107452360 0011522 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Chat\V1\Service\ChannelList; use Twilio\Rest\Chat\V1\Service\RoleList; use Twilio\Rest\Chat\V1\Service\UserList; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $defaultServiceRoleSid * @property string $defaultChannelRoleSid * @property string $defaultChannelCreatorRoleSid * @property bool $readStatusEnabled * @property bool $reachabilityEnabled * @property int $typingIndicatorTimeout * @property int $consumptionReportInterval * @property array $limits * @property array $webhooks * @property string $preWebhookUrl * @property string $postWebhookUrl * @property string $webhookMethod * @property string[] $webhookFilters * @property array $notifications * @property string $url * @property array $links */ class ServiceInstance extends InstanceResource { protected $_channels; protected $_roles; protected $_users; /** * Initialize the ServiceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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) . ']'; } } Chat/V1/ServiceList.php 0000644 00000012044 15107452360 0010662 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ServiceList extends ListResource { /** * Construct the ServiceList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Services'; } /** * Create the ServiceInstance * * @param string $friendlyName A string to describe the resource * @return ServiceInstance Created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName): ServiceInstance { $data = Values::of(['FriendlyName' => $friendlyName, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ServiceInstance($this->version, $payload); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 unique string that identifies the 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.Chat.V1.ServiceList]'; } } Chat/V1/ServiceContext.php 0000644 00000022614 15107452360 0011377 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Chat\V1\Service\ChannelList; use Twilio\Rest\Chat\V1\Service\RoleList; use Twilio\Rest\Chat\V1\Service\UserList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property ChannelList $channels * @property RoleList $roles * @property UserList $users * @method \Twilio\Rest\Chat\V1\Service\ChannelContext channels(string $sid) * @method \Twilio\Rest\Chat\V1\Service\RoleContext roles(string $sid) * @method \Twilio\Rest\Chat\V1\Service\UserContext users(string $sid) */ class ServiceContext extends InstanceContext { protected $_channels; protected $_roles; protected $_users; /** * Initialize the ServiceContext * * @param Version $version Version that contains the resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($sid) . ''; } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { $payload = $this->version->fetch('GET', $this->uri); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } Chat/V1/CredentialContext.php 0000644 00000005245 15107452360 0012052 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class CredentialContext extends InstanceContext { /** * Initialize the CredentialContext * * @param Version $version Version that contains the resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Credentials/' . \rawurlencode($sid) . ''; } /** * Fetch the CredentialInstance * * @return CredentialInstance Fetched CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new CredentialInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the CredentialInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Chat/V1/CredentialList.php 0000644 00000013176 15107452360 0011343 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class CredentialList extends ListResource { /** * Construct the CredentialList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Credentials'; } /** * Streams CredentialInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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); } /** * Create the CredentialInstance * * @param string $type The type of push-notification service the credential is * for * @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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CredentialInstance($this->version, $payload); } /** * Constructs a CredentialContext * * @param string $sid The unique string that identifies the 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.Chat.V1.CredentialList]'; } } Chat/V1/CredentialInstance.php 0000644 00000007742 15107452360 0012176 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $friendlyName * @property string $type * @property string $sandbox * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class CredentialInstance extends InstanceResource { /** * Initialize the CredentialInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Chat/V1/ServiceOptions.php 0000644 00000203441 15107452360 0011405 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1; use Twilio\Options; use Twilio\Values; abstract class ServiceOptions { /** * @param string $friendlyName A string to describe the resource * @param string $defaultServiceRoleSid The service role assigned to users when * they are added to the service * @param string $defaultChannelRoleSid The channel role assigned to users when * they are added to a channel * @param string $defaultChannelCreatorRoleSid The channel role assigned to a * channel creator when they join a * new channel * @param bool $readStatusEnabled Whether to enable the Message Consumption * Horizon feature * @param bool $reachabilityEnabled Whether to enable the Reachability * Indicator feature for this Service instance * @param int $typingIndicatorTimeout How long in seconds to wait before * assuming the user is no longer typing * @param int $consumptionReportInterval DEPRECATED * @param bool $notificationsNewMessageEnabled Whether to send a notification * when a new message is added to a * channel * @param string $notificationsNewMessageTemplate The template to use to create * the notification text * displayed when a new message * is added to a channel * @param bool $notificationsAddedToChannelEnabled Whether to send a * notification when a member * is added to a channel * @param string $notificationsAddedToChannelTemplate The template to use to * create the notification * text displayed when a * member is added to a * channel * @param bool $notificationsRemovedFromChannelEnabled Whether to send a * notification to a user * when they are removed * from a channel * @param string $notificationsRemovedFromChannelTemplate The template to use * to create the * notification text * displayed to a user * when they are removed * @param bool $notificationsInvitedToChannelEnabled Whether to send a * notification when a user * is invited to a channel * @param string $notificationsInvitedToChannelTemplate The template to use to * create the notification * text displayed when a * user is invited to a * channel * @param string $preWebhookUrl The webhook URL for pre-event webhooks * @param string $postWebhookUrl The URL for post-event webhooks * @param string $webhookMethod The HTTP method to use for both PRE and POST * webhooks * @param string[] $webhookFilters The list of WebHook events that are enabled * for this Service instance * @param string $webhooksOnMessageSendUrl The URL of the webhook to call in * response to the on_message_send event * @param string $webhooksOnMessageSendMethod The HTTP method to use when * calling the * webhooks.on_message_send.url * @param string $webhooksOnMessageUpdateUrl The URL of the webhook to call in * response to the on_message_update * event * @param string $webhooksOnMessageUpdateMethod The HTTP method to use when * calling the * webhooks.on_message_update.url * @param string $webhooksOnMessageRemoveUrl The URL of the webhook to call in * response to the on_message_remove * event * @param string $webhooksOnMessageRemoveMethod The HTTP method to use when * calling the * webhooks.on_message_remove.url * @param string $webhooksOnChannelAddUrl The URL of the webhook to call in * response to the on_channel_add event * @param string $webhooksOnChannelAddMethod The HTTP method to use when * calling the * webhooks.on_channel_add.url * @param string $webhooksOnChannelDestroyUrl The URL of the webhook to call in * response to the * on_channel_destroy event * @param string $webhooksOnChannelDestroyMethod The HTTP method to use when * calling the * webhooks.on_channel_destroy.url * @param string $webhooksOnChannelUpdateUrl The URL of the webhook to call in * response to the on_channel_update * event * @param string $webhooksOnChannelUpdateMethod The HTTP method to use when * calling the * webhooks.on_channel_update.url * @param string $webhooksOnMemberAddUrl The URL of the webhook to call in * response to the on_member_add event * @param string $webhooksOnMemberAddMethod The HTTP method to use when calling * the webhooks.on_member_add.url * @param string $webhooksOnMemberRemoveUrl The URL of the webhook to call in * response to the on_member_remove * event * @param string $webhooksOnMemberRemoveMethod The HTTP method to use when * calling the * webhooks.on_member_remove.url * @param string $webhooksOnMessageSentUrl The URL of the webhook to call in * response to the on_message_sent event * @param string $webhooksOnMessageSentMethod The URL of the webhook to call in * response to the on_message_sent * event * @param string $webhooksOnMessageUpdatedUrl The URL of the webhook to call in * response to the * on_message_updated event * @param string $webhooksOnMessageUpdatedMethod The HTTP method to use when * calling the * webhooks.on_message_updated.url * @param string $webhooksOnMessageRemovedUrl The URL of the webhook to call in * response to the * on_message_removed event * @param string $webhooksOnMessageRemovedMethod The HTTP method to use when * calling the * webhooks.on_message_removed.url * @param string $webhooksOnChannelAddedUrl The URL of the webhook to call in * response to the on_channel_added * event * @param string $webhooksOnChannelAddedMethod The URL of the webhook to call * in response to the * on_channel_added event * @param string $webhooksOnChannelDestroyedUrl The URL of the webhook to call * in response to the * on_channel_added event * @param string $webhooksOnChannelDestroyedMethod The HTTP method to use when * calling the * webhooks.on_channel_destroyed.url * @param string $webhooksOnChannelUpdatedUrl he URL of the webhook to call in * response to the * on_channel_updated event * @param string $webhooksOnChannelUpdatedMethod The HTTP method to use when * calling the * webhooks.on_channel_updated.url * @param string $webhooksOnMemberAddedUrl The URL of the webhook to call in * response to the on_channel_updated * event * @param string $webhooksOnMemberAddedMethod he HTTP method to use when * calling the * webhooks.on_channel_updated.url * @param string $webhooksOnMemberRemovedUrl The URL of the webhook to call in * response to the on_member_removed * event * @param string $webhooksOnMemberRemovedMethod The HTTP method to use when * calling the * webhooks.on_member_removed.url * @param int $limitsChannelMembers The maximum number of Members that can be * added to Channels within this Service * @param int $limitsUserChannels The maximum number of Channels Users can be a * Member of within this Service * @return UpdateServiceOptions Options builder */ public static function update(string $friendlyName = Values::NONE, string $defaultServiceRoleSid = Values::NONE, string $defaultChannelRoleSid = Values::NONE, string $defaultChannelCreatorRoleSid = Values::NONE, bool $readStatusEnabled = Values::NONE, bool $reachabilityEnabled = Values::NONE, int $typingIndicatorTimeout = Values::NONE, int $consumptionReportInterval = Values::NONE, bool $notificationsNewMessageEnabled = Values::NONE, string $notificationsNewMessageTemplate = Values::NONE, bool $notificationsAddedToChannelEnabled = Values::NONE, string $notificationsAddedToChannelTemplate = Values::NONE, bool $notificationsRemovedFromChannelEnabled = Values::NONE, string $notificationsRemovedFromChannelTemplate = Values::NONE, bool $notificationsInvitedToChannelEnabled = Values::NONE, string $notificationsInvitedToChannelTemplate = Values::NONE, string $preWebhookUrl = Values::NONE, string $postWebhookUrl = Values::NONE, string $webhookMethod = Values::NONE, array $webhookFilters = Values::ARRAY_NONE, string $webhooksOnMessageSendUrl = Values::NONE, string $webhooksOnMessageSendMethod = Values::NONE, string $webhooksOnMessageUpdateUrl = Values::NONE, string $webhooksOnMessageUpdateMethod = Values::NONE, string $webhooksOnMessageRemoveUrl = Values::NONE, string $webhooksOnMessageRemoveMethod = Values::NONE, string $webhooksOnChannelAddUrl = Values::NONE, string $webhooksOnChannelAddMethod = Values::NONE, string $webhooksOnChannelDestroyUrl = Values::NONE, string $webhooksOnChannelDestroyMethod = Values::NONE, string $webhooksOnChannelUpdateUrl = Values::NONE, string $webhooksOnChannelUpdateMethod = Values::NONE, string $webhooksOnMemberAddUrl = Values::NONE, string $webhooksOnMemberAddMethod = Values::NONE, string $webhooksOnMemberRemoveUrl = Values::NONE, string $webhooksOnMemberRemoveMethod = Values::NONE, string $webhooksOnMessageSentUrl = Values::NONE, string $webhooksOnMessageSentMethod = Values::NONE, string $webhooksOnMessageUpdatedUrl = Values::NONE, string $webhooksOnMessageUpdatedMethod = Values::NONE, string $webhooksOnMessageRemovedUrl = Values::NONE, string $webhooksOnMessageRemovedMethod = Values::NONE, string $webhooksOnChannelAddedUrl = Values::NONE, string $webhooksOnChannelAddedMethod = Values::NONE, string $webhooksOnChannelDestroyedUrl = Values::NONE, string $webhooksOnChannelDestroyedMethod = Values::NONE, string $webhooksOnChannelUpdatedUrl = Values::NONE, string $webhooksOnChannelUpdatedMethod = Values::NONE, string $webhooksOnMemberAddedUrl = Values::NONE, string $webhooksOnMemberAddedMethod = Values::NONE, string $webhooksOnMemberRemovedUrl = Values::NONE, string $webhooksOnMemberRemovedMethod = Values::NONE, int $limitsChannelMembers = Values::NONE, int $limitsUserChannels = Values::NONE): UpdateServiceOptions { return new UpdateServiceOptions($friendlyName, $defaultServiceRoleSid, $defaultChannelRoleSid, $defaultChannelCreatorRoleSid, $readStatusEnabled, $reachabilityEnabled, $typingIndicatorTimeout, $consumptionReportInterval, $notificationsNewMessageEnabled, $notificationsNewMessageTemplate, $notificationsAddedToChannelEnabled, $notificationsAddedToChannelTemplate, $notificationsRemovedFromChannelEnabled, $notificationsRemovedFromChannelTemplate, $notificationsInvitedToChannelEnabled, $notificationsInvitedToChannelTemplate, $preWebhookUrl, $postWebhookUrl, $webhookMethod, $webhookFilters, $webhooksOnMessageSendUrl, $webhooksOnMessageSendMethod, $webhooksOnMessageUpdateUrl, $webhooksOnMessageUpdateMethod, $webhooksOnMessageRemoveUrl, $webhooksOnMessageRemoveMethod, $webhooksOnChannelAddUrl, $webhooksOnChannelAddMethod, $webhooksOnChannelDestroyUrl, $webhooksOnChannelDestroyMethod, $webhooksOnChannelUpdateUrl, $webhooksOnChannelUpdateMethod, $webhooksOnMemberAddUrl, $webhooksOnMemberAddMethod, $webhooksOnMemberRemoveUrl, $webhooksOnMemberRemoveMethod, $webhooksOnMessageSentUrl, $webhooksOnMessageSentMethod, $webhooksOnMessageUpdatedUrl, $webhooksOnMessageUpdatedMethod, $webhooksOnMessageRemovedUrl, $webhooksOnMessageRemovedMethod, $webhooksOnChannelAddedUrl, $webhooksOnChannelAddedMethod, $webhooksOnChannelDestroyedUrl, $webhooksOnChannelDestroyedMethod, $webhooksOnChannelUpdatedUrl, $webhooksOnChannelUpdatedMethod, $webhooksOnMemberAddedUrl, $webhooksOnMemberAddedMethod, $webhooksOnMemberRemovedUrl, $webhooksOnMemberRemovedMethod, $limitsChannelMembers, $limitsUserChannels); } } class UpdateServiceOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $defaultServiceRoleSid The service role assigned to users when * they are added to the service * @param string $defaultChannelRoleSid The channel role assigned to users when * they are added to a channel * @param string $defaultChannelCreatorRoleSid The channel role assigned to a * channel creator when they join a * new channel * @param bool $readStatusEnabled Whether to enable the Message Consumption * Horizon feature * @param bool $reachabilityEnabled Whether to enable the Reachability * Indicator feature for this Service instance * @param int $typingIndicatorTimeout How long in seconds to wait before * assuming the user is no longer typing * @param int $consumptionReportInterval DEPRECATED * @param bool $notificationsNewMessageEnabled Whether to send a notification * when a new message is added to a * channel * @param string $notificationsNewMessageTemplate The template to use to create * the notification text * displayed when a new message * is added to a channel * @param bool $notificationsAddedToChannelEnabled Whether to send a * notification when a member * is added to a channel * @param string $notificationsAddedToChannelTemplate The template to use to * create the notification * text displayed when a * member is added to a * channel * @param bool $notificationsRemovedFromChannelEnabled Whether to send a * notification to a user * when they are removed * from a channel * @param string $notificationsRemovedFromChannelTemplate The template to use * to create the * notification text * displayed to a user * when they are removed * @param bool $notificationsInvitedToChannelEnabled Whether to send a * notification when a user * is invited to a channel * @param string $notificationsInvitedToChannelTemplate The template to use to * create the notification * text displayed when a * user is invited to a * channel * @param string $preWebhookUrl The webhook URL for pre-event webhooks * @param string $postWebhookUrl The URL for post-event webhooks * @param string $webhookMethod The HTTP method to use for both PRE and POST * webhooks * @param string[] $webhookFilters The list of WebHook events that are enabled * for this Service instance * @param string $webhooksOnMessageSendUrl The URL of the webhook to call in * response to the on_message_send event * @param string $webhooksOnMessageSendMethod The HTTP method to use when * calling the * webhooks.on_message_send.url * @param string $webhooksOnMessageUpdateUrl The URL of the webhook to call in * response to the on_message_update * event * @param string $webhooksOnMessageUpdateMethod The HTTP method to use when * calling the * webhooks.on_message_update.url * @param string $webhooksOnMessageRemoveUrl The URL of the webhook to call in * response to the on_message_remove * event * @param string $webhooksOnMessageRemoveMethod The HTTP method to use when * calling the * webhooks.on_message_remove.url * @param string $webhooksOnChannelAddUrl The URL of the webhook to call in * response to the on_channel_add event * @param string $webhooksOnChannelAddMethod The HTTP method to use when * calling the * webhooks.on_channel_add.url * @param string $webhooksOnChannelDestroyUrl The URL of the webhook to call in * response to the * on_channel_destroy event * @param string $webhooksOnChannelDestroyMethod The HTTP method to use when * calling the * webhooks.on_channel_destroy.url * @param string $webhooksOnChannelUpdateUrl The URL of the webhook to call in * response to the on_channel_update * event * @param string $webhooksOnChannelUpdateMethod The HTTP method to use when * calling the * webhooks.on_channel_update.url * @param string $webhooksOnMemberAddUrl The URL of the webhook to call in * response to the on_member_add event * @param string $webhooksOnMemberAddMethod The HTTP method to use when calling * the webhooks.on_member_add.url * @param string $webhooksOnMemberRemoveUrl The URL of the webhook to call in * response to the on_member_remove * event * @param string $webhooksOnMemberRemoveMethod The HTTP method to use when * calling the * webhooks.on_member_remove.url * @param string $webhooksOnMessageSentUrl The URL of the webhook to call in * response to the on_message_sent event * @param string $webhooksOnMessageSentMethod The URL of the webhook to call in * response to the on_message_sent * event * @param string $webhooksOnMessageUpdatedUrl The URL of the webhook to call in * response to the * on_message_updated event * @param string $webhooksOnMessageUpdatedMethod The HTTP method to use when * calling the * webhooks.on_message_updated.url * @param string $webhooksOnMessageRemovedUrl The URL of the webhook to call in * response to the * on_message_removed event * @param string $webhooksOnMessageRemovedMethod The HTTP method to use when * calling the * webhooks.on_message_removed.url * @param string $webhooksOnChannelAddedUrl The URL of the webhook to call in * response to the on_channel_added * event * @param string $webhooksOnChannelAddedMethod The URL of the webhook to call * in response to the * on_channel_added event * @param string $webhooksOnChannelDestroyedUrl The URL of the webhook to call * in response to the * on_channel_added event * @param string $webhooksOnChannelDestroyedMethod The HTTP method to use when * calling the * webhooks.on_channel_destroyed.url * @param string $webhooksOnChannelUpdatedUrl he URL of the webhook to call in * response to the * on_channel_updated event * @param string $webhooksOnChannelUpdatedMethod The HTTP method to use when * calling the * webhooks.on_channel_updated.url * @param string $webhooksOnMemberAddedUrl The URL of the webhook to call in * response to the on_channel_updated * event * @param string $webhooksOnMemberAddedMethod he HTTP method to use when * calling the * webhooks.on_channel_updated.url * @param string $webhooksOnMemberRemovedUrl The URL of the webhook to call in * response to the on_member_removed * event * @param string $webhooksOnMemberRemovedMethod The HTTP method to use when * calling the * webhooks.on_member_removed.url * @param int $limitsChannelMembers The maximum number of Members that can be * added to Channels within this Service * @param int $limitsUserChannels The maximum number of Channels Users can be a * Member of within this Service */ public function __construct(string $friendlyName = Values::NONE, string $defaultServiceRoleSid = Values::NONE, string $defaultChannelRoleSid = Values::NONE, string $defaultChannelCreatorRoleSid = Values::NONE, bool $readStatusEnabled = Values::NONE, bool $reachabilityEnabled = Values::NONE, int $typingIndicatorTimeout = Values::NONE, int $consumptionReportInterval = Values::NONE, bool $notificationsNewMessageEnabled = Values::NONE, string $notificationsNewMessageTemplate = Values::NONE, bool $notificationsAddedToChannelEnabled = Values::NONE, string $notificationsAddedToChannelTemplate = Values::NONE, bool $notificationsRemovedFromChannelEnabled = Values::NONE, string $notificationsRemovedFromChannelTemplate = Values::NONE, bool $notificationsInvitedToChannelEnabled = Values::NONE, string $notificationsInvitedToChannelTemplate = Values::NONE, string $preWebhookUrl = Values::NONE, string $postWebhookUrl = Values::NONE, string $webhookMethod = Values::NONE, array $webhookFilters = Values::ARRAY_NONE, string $webhooksOnMessageSendUrl = Values::NONE, string $webhooksOnMessageSendMethod = Values::NONE, string $webhooksOnMessageUpdateUrl = Values::NONE, string $webhooksOnMessageUpdateMethod = Values::NONE, string $webhooksOnMessageRemoveUrl = Values::NONE, string $webhooksOnMessageRemoveMethod = Values::NONE, string $webhooksOnChannelAddUrl = Values::NONE, string $webhooksOnChannelAddMethod = Values::NONE, string $webhooksOnChannelDestroyUrl = Values::NONE, string $webhooksOnChannelDestroyMethod = Values::NONE, string $webhooksOnChannelUpdateUrl = Values::NONE, string $webhooksOnChannelUpdateMethod = Values::NONE, string $webhooksOnMemberAddUrl = Values::NONE, string $webhooksOnMemberAddMethod = Values::NONE, string $webhooksOnMemberRemoveUrl = Values::NONE, string $webhooksOnMemberRemoveMethod = Values::NONE, string $webhooksOnMessageSentUrl = Values::NONE, string $webhooksOnMessageSentMethod = Values::NONE, string $webhooksOnMessageUpdatedUrl = Values::NONE, string $webhooksOnMessageUpdatedMethod = Values::NONE, string $webhooksOnMessageRemovedUrl = Values::NONE, string $webhooksOnMessageRemovedMethod = Values::NONE, string $webhooksOnChannelAddedUrl = Values::NONE, string $webhooksOnChannelAddedMethod = Values::NONE, string $webhooksOnChannelDestroyedUrl = Values::NONE, string $webhooksOnChannelDestroyedMethod = Values::NONE, string $webhooksOnChannelUpdatedUrl = Values::NONE, string $webhooksOnChannelUpdatedMethod = Values::NONE, string $webhooksOnMemberAddedUrl = Values::NONE, string $webhooksOnMemberAddedMethod = Values::NONE, string $webhooksOnMemberRemovedUrl = Values::NONE, string $webhooksOnMemberRemovedMethod = Values::NONE, int $limitsChannelMembers = Values::NONE, int $limitsUserChannels = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; $this->options['readStatusEnabled'] = $readStatusEnabled; $this->options['reachabilityEnabled'] = $reachabilityEnabled; $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; $this->options['consumptionReportInterval'] = $consumptionReportInterval; $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; $this->options['preWebhookUrl'] = $preWebhookUrl; $this->options['postWebhookUrl'] = $postWebhookUrl; $this->options['webhookMethod'] = $webhookMethod; $this->options['webhookFilters'] = $webhookFilters; $this->options['webhooksOnMessageSendUrl'] = $webhooksOnMessageSendUrl; $this->options['webhooksOnMessageSendMethod'] = $webhooksOnMessageSendMethod; $this->options['webhooksOnMessageUpdateUrl'] = $webhooksOnMessageUpdateUrl; $this->options['webhooksOnMessageUpdateMethod'] = $webhooksOnMessageUpdateMethod; $this->options['webhooksOnMessageRemoveUrl'] = $webhooksOnMessageRemoveUrl; $this->options['webhooksOnMessageRemoveMethod'] = $webhooksOnMessageRemoveMethod; $this->options['webhooksOnChannelAddUrl'] = $webhooksOnChannelAddUrl; $this->options['webhooksOnChannelAddMethod'] = $webhooksOnChannelAddMethod; $this->options['webhooksOnChannelDestroyUrl'] = $webhooksOnChannelDestroyUrl; $this->options['webhooksOnChannelDestroyMethod'] = $webhooksOnChannelDestroyMethod; $this->options['webhooksOnChannelUpdateUrl'] = $webhooksOnChannelUpdateUrl; $this->options['webhooksOnChannelUpdateMethod'] = $webhooksOnChannelUpdateMethod; $this->options['webhooksOnMemberAddUrl'] = $webhooksOnMemberAddUrl; $this->options['webhooksOnMemberAddMethod'] = $webhooksOnMemberAddMethod; $this->options['webhooksOnMemberRemoveUrl'] = $webhooksOnMemberRemoveUrl; $this->options['webhooksOnMemberRemoveMethod'] = $webhooksOnMemberRemoveMethod; $this->options['webhooksOnMessageSentUrl'] = $webhooksOnMessageSentUrl; $this->options['webhooksOnMessageSentMethod'] = $webhooksOnMessageSentMethod; $this->options['webhooksOnMessageUpdatedUrl'] = $webhooksOnMessageUpdatedUrl; $this->options['webhooksOnMessageUpdatedMethod'] = $webhooksOnMessageUpdatedMethod; $this->options['webhooksOnMessageRemovedUrl'] = $webhooksOnMessageRemovedUrl; $this->options['webhooksOnMessageRemovedMethod'] = $webhooksOnMessageRemovedMethod; $this->options['webhooksOnChannelAddedUrl'] = $webhooksOnChannelAddedUrl; $this->options['webhooksOnChannelAddedMethod'] = $webhooksOnChannelAddedMethod; $this->options['webhooksOnChannelDestroyedUrl'] = $webhooksOnChannelDestroyedUrl; $this->options['webhooksOnChannelDestroyedMethod'] = $webhooksOnChannelDestroyedMethod; $this->options['webhooksOnChannelUpdatedUrl'] = $webhooksOnChannelUpdatedUrl; $this->options['webhooksOnChannelUpdatedMethod'] = $webhooksOnChannelUpdatedMethod; $this->options['webhooksOnMemberAddedUrl'] = $webhooksOnMemberAddedUrl; $this->options['webhooksOnMemberAddedMethod'] = $webhooksOnMemberAddedMethod; $this->options['webhooksOnMemberRemovedUrl'] = $webhooksOnMemberRemovedUrl; $this->options['webhooksOnMemberRemovedMethod'] = $webhooksOnMemberRemovedMethod; $this->options['limitsChannelMembers'] = $limitsChannelMembers; $this->options['limitsUserChannels'] = $limitsUserChannels; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName(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 * @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 * @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 * @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 feature * @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 feature for this Service instance * @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 to wait before * assuming the user is no longer typing * @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 * @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 * @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 * @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 * @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 * @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 * @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 * @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 * @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 * @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 webhook URL for pre-event webhooks * @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 * @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 both PRE and POST * webhooks * @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 * @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 * @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 * @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 * @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 * @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 * @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 * @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 * @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 * @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 * @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 * @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 * @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 * @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 * @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 he URL of the webhook to call in * response to the * on_channel_updated event * @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 * @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 he 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 * @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 * @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 * @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 . ']'; } } Chat/V1/ServicePage.php 0000644 00000002163 15107452360 0010624 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ServicePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Chat/V3/ChannelOptions.php 0000644 00000006340 15107452360 0011356 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V3; use Twilio\Options; use Twilio\Values; abstract class ChannelOptions { /** * @param string $type The Type for this Channel to migrate to. * @param string $messagingServiceSid The unique ID of the Messaging Service * this channel belongs to. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return UpdateChannelOptions Options builder */ public static function update(string $type = Values::NONE, string $messagingServiceSid = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE): UpdateChannelOptions { return new UpdateChannelOptions($type, $messagingServiceSid, $xTwilioWebhookEnabled); } } class UpdateChannelOptions extends Options { /** * @param string $type The Type for this Channel to migrate to. * @param string $messagingServiceSid The unique ID of the Messaging Service * this channel belongs to. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header */ public function __construct(string $type = Values::NONE, string $messagingServiceSid = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE) { $this->options['type'] = $type; $this->options['messagingServiceSid'] = $messagingServiceSid; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * TThe Type for this Channel to migrate to. Can only be `private`. Migration to 'public' is not allowed. * * @param string $type The Type for this Channel to migrate to. * @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/sms/services/api) this channel belongs to. * * @param string $messagingServiceSid The unique ID of the Messaging Service * 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 . ']'; } } Chat/V3/ChannelPage.php 0000644 00000002163 15107452360 0010576 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V3; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ChannelPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Chat/V3/ChannelList.php 0000644 00000002050 15107452360 0010630 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V3; use Twilio\ListResource; use Twilio\Version; class ChannelList extends ListResource { /** * Construct the ChannelList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; } /** * Constructs a ChannelContext * * @param string $serviceSid Service Sid. * @param string $sid A 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]'; } } Chat/V3/ChannelInstance.php 0000644 00000010511 15107452360 0011462 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V3; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $friendlyName * @property string $uniqueName * @property string $attributes * @property string $type * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $createdBy * @property int $membersCount * @property int $messagesCount * @property string $messagingServiceSid * @property string $url */ class ChannelInstance extends InstanceResource { /** * Initialize the ChannelInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid Service Sid. * @param string $sid A string that uniquely identifies this Channel. */ public function __construct(Version $version, array $payload, string $serviceSid = null, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Chat/V3/ChannelContext.php 0000644 00000004114 15107452360 0011344 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V3; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class ChannelContext extends InstanceContext { /** * Initialize the ChannelContext * * @param Version $version Version that contains the resource * @param string $serviceSid Service Sid. * @param string $sid A string that uniquely identifies this Channel. */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->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(['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) . ']'; } } Chat/V1.php 0000644 00000005037 15107452360 0006432 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Chat\V1\CredentialList; use Twilio\Rest\Chat\V1\ServiceList; use Twilio\Version; /** * @property CredentialList $credentials * @property ServiceList $services * @method \Twilio\Rest\Chat\V1\CredentialContext credentials(string $sid) * @method \Twilio\Rest\Chat\V1\ServiceContext services(string $sid) */ class V1 extends Version { protected $_credentials; protected $_services; /** * Construct the V1 version of Chat * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->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]'; } } Chat/V2/CredentialPage.php 0000644 00000002205 15107452360 0011274 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CredentialPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Chat/V2/CredentialOptions.php 0000644 00000027120 15107452360 0012056 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2; use Twilio\Options; use Twilio\Values; abstract class CredentialOptions { /** * @param string $friendlyName A string to describe the resource * @param string $certificate [APN only] The URL encoded representation of the * certificate * @param string $privateKey [APN only] The URL encoded representation of the * private key * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @param string $apiKey [GCM only] The API key for the project that was * obtained from the Google Developer console for your * GCM Service application credential * @param string $secret [FCM only] The Server key of your project from * Firebase console * @return CreateCredentialOptions Options builder */ public static function create(string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::NONE, string $apiKey = Values::NONE, string $secret = Values::NONE): CreateCredentialOptions { return new CreateCredentialOptions($friendlyName, $certificate, $privateKey, $sandbox, $apiKey, $secret); } /** * @param string $friendlyName A string to describe the resource * @param string $certificate [APN only] The URL encoded representation of the * certificate * @param string $privateKey [APN only] The URL encoded representation of the * private key * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @param string $apiKey [GCM only] The API key for the project that was * obtained from the Google Developer console for your * GCM Service application credential * @param string $secret [FCM only] The Server key of your project from * Firebase console * @return UpdateCredentialOptions Options builder */ public static function update(string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::NONE, string $apiKey = Values::NONE, string $secret = Values::NONE): UpdateCredentialOptions { return new UpdateCredentialOptions($friendlyName, $certificate, $privateKey, $sandbox, $apiKey, $secret); } } class CreateCredentialOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $certificate [APN only] The URL encoded representation of the * certificate * @param string $privateKey [APN only] The URL encoded representation of the * private key * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @param string $apiKey [GCM only] The API key for the project that was * obtained from the Google Developer console for your * GCM Service application credential * @param string $secret [FCM only] The Server key of your project from * Firebase console */ public function __construct(string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::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 new resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName(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 * @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 * @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 * @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 * Firebase console * @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 string to describe the resource * @param string $certificate [APN only] The URL encoded representation of the * certificate * @param string $privateKey [APN only] The URL encoded representation of the * private key * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @param string $apiKey [GCM only] The API key for the project that was * obtained from the Google Developer console for your * GCM Service application credential * @param string $secret [FCM only] The Server key of your project from * Firebase console */ public function __construct(string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::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 string to describe the resource * @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 * @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 * @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 * @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 * Firebase console * @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 . ']'; } } Chat/V2/Service/BindingContext.php 0000644 00000003745 15107452360 0012756 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class BindingContext extends InstanceContext { /** * Initialize the BindingContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $sid The SID of the resource to fetch */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Bindings/' . \rawurlencode($sid) . ''; } /** * Fetch the BindingInstance * * @return BindingInstance Fetched BindingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): BindingInstance { $payload = $this->version->fetch('GET', $this->uri); return new BindingInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Delete the BindingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Chat/V2/Service/UserInstance.php 0000644 00000012364 15107452360 0012437 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Chat\V2\Service\User\UserBindingList; use Twilio\Rest\Chat\V2\Service\User\UserChannelList; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $attributes * @property string $friendlyName * @property string $roleSid * @property string $identity * @property bool $isOnline * @property bool $isNotifiable * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property int $joinedChannelsCount * @property array $links * @property string $url */ class UserInstance extends InstanceResource { protected $_userChannels; protected $_userBindings; /** * Initialize the UserInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $sid The SID of the User resource to fetch */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the UserInstance * * @return UserInstance Fetched UserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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; } /** * Access the userBindings */ protected function getUserBindings(): UserBindingList { return $this->proxy()->userBindings; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Chat/V2/Service/BindingOptions.php 0000644 00000004756 15107452360 0012770 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Options; use Twilio\Values; abstract class BindingOptions { /** * @param string[] $bindingType The push technology used by the Binding * resources to read * @param string[] $identity The `identity` value of the resources to read * @return ReadBindingOptions Options builder */ public static function read(array $bindingType = Values::ARRAY_NONE, array $identity = Values::ARRAY_NONE): ReadBindingOptions { return new ReadBindingOptions($bindingType, $identity); } } class ReadBindingOptions extends Options { /** * @param string[] $bindingType The push technology used by the Binding * resources to read * @param string[] $identity The `identity` value of the resources to read */ public function __construct(array $bindingType = Values::ARRAY_NONE, array $identity = Values::ARRAY_NONE) { $this->options['bindingType'] = $bindingType; $this->options['identity'] = $identity; } /** * The push technology used by the Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. * * @param string[] $bindingType The push technology used by the Binding * resources to read * @return $this Fluent Builder */ public function setBindingType(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 `identity` value of the resources to read * @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 . ']'; } } Chat/V2/Service/UserOptions.php 0000644 00000016345 15107452360 0012331 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Options; use Twilio\Values; abstract class UserOptions { /** * @param string $roleSid The SID of the Role assigned to this user * @param string $attributes A valid JSON string that contains * application-specific data * @param string $friendlyName A string to describe the new resource * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return CreateUserOptions Options builder */ public static function create(string $roleSid = Values::NONE, string $attributes = Values::NONE, string $friendlyName = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE): CreateUserOptions { return new CreateUserOptions($roleSid, $attributes, $friendlyName, $xTwilioWebhookEnabled); } /** * @param string $roleSid The SID id of the Role assigned to this user * @param string $attributes A valid JSON string that contains * application-specific data * @param string $friendlyName A string to describe the resource * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return UpdateUserOptions Options builder */ public static function update(string $roleSid = Values::NONE, string $attributes = Values::NONE, string $friendlyName = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE): UpdateUserOptions { return new UpdateUserOptions($roleSid, $attributes, $friendlyName, $xTwilioWebhookEnabled); } } class CreateUserOptions extends Options { /** * @param string $roleSid The SID of the Role assigned to this user * @param string $attributes A valid JSON string that contains * application-specific data * @param string $friendlyName A string to describe the new resource * @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 new User. * * @param string $roleSid The SID of the Role 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 new resource. This value is often used for display purposes. * * @param string $friendlyName A string to describe the new resource * @return $this Fluent Builder */ public function setFriendlyName(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 id of the Role assigned to this user * @param string $attributes A valid JSON string that contains * application-specific data * @param string $friendlyName A string to describe the resource * @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 id of the Role 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 string to describe the resource * @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 . ']'; } } Chat/V2/Service/ChannelOptions.php 0000644 00000040752 15107452360 0012762 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Options; use Twilio\Values; abstract class ChannelOptions { /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return DeleteChannelOptions Options builder */ public static function delete(string $xTwilioWebhookEnabled = Values::NONE): DeleteChannelOptions { return new DeleteChannelOptions($xTwilioWebhookEnabled); } /** * @param string $friendlyName A string to describe the new resource * @param string $uniqueName An application-defined string that uniquely * identifies the Channel resource * @param string $attributes A valid JSON string that contains * application-specific data * @param string $type The visibility of the channel * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $createdBy The identity of the User that created the Channel * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return CreateChannelOptions Options builder */ public static function create(string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, string $attributes = Values::NONE, string $type = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, string $createdBy = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE): CreateChannelOptions { return new CreateChannelOptions($friendlyName, $uniqueName, $attributes, $type, $dateCreated, $dateUpdated, $createdBy, $xTwilioWebhookEnabled); } /** * @param string[] $type The visibility of the channel to read * @return ReadChannelOptions Options builder */ public static function read(array $type = Values::ARRAY_NONE): ReadChannelOptions { return new ReadChannelOptions($type); } /** * @param string $friendlyName A string to describe the resource * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $attributes A valid JSON string that contains * application-specific data * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $createdBy The identity of the User that created the Channel * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return UpdateChannelOptions Options builder */ public static function update(string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, string $attributes = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, string $createdBy = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE): UpdateChannelOptions { return new UpdateChannelOptions($friendlyName, $uniqueName, $attributes, $dateCreated, $dateUpdated, $createdBy, $xTwilioWebhookEnabled); } } 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 CreateChannelOptions extends Options { /** * @param string $friendlyName A string to describe the new resource * @param string $uniqueName An application-defined string that uniquely * identifies the Channel resource * @param string $attributes A valid JSON string that contains * application-specific data * @param string $type The visibility of the channel * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $createdBy The identity of the User that created the Channel * @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, string $type = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, string $createdBy = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['attributes'] = $attributes; $this->options['type'] = $type; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['createdBy'] = $createdBy; $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 string to describe the new resource * @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 Channel resource * @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 visibility of the channel. Can be: `public` or `private` and defaults to `public`. * * @param string $type The visibility of the channel * @return $this Fluent Builder */ public function setType(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 ISO 8601 date and time in GMT when the * resource was created * @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 ISO 8601 date and time in GMT when the * resource was 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 * @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 ReadChannelOptions extends Options { /** * @param string[] $type The visibility of the channel to read */ 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 channel to read * @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 string to describe the resource * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $attributes A valid JSON string that contains * application-specific data * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $createdBy The identity of the User that created the Channel * @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 = Values::NONE, \DateTime $dateUpdated = Values::NONE, 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 string to describe the resource * @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 * @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 ISO 8601 date and time in GMT when the * resource was created * @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 ISO 8601 date and time in GMT when the * resource was 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 * @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 . ']'; } } Chat/V2/Service/ChannelPage.php 0000644 00000002242 15107452360 0012173 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ChannelPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Chat/V2/Service/ChannelList.php 0000644 00000014417 15107452360 0012241 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ChannelList extends ListResource { /** * Construct the ChannelList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with */ public function __construct(Version $version, string $serviceSid) { parent::__construct($version); // Path Solution $this->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(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled'], ]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new ChannelInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams ChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of ChannelInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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' => Serialize::map($options['type'], function($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ChannelPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ChannelInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return 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 resource */ 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]'; } } Chat/V2/Service/Channel/WebhookPage.php 0000644 00000002413 15107452360 0013571 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class WebhookPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Chat/V2/Service/Channel/MemberOptions.php 0000644 00000045071 15107452360 0014170 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class MemberOptions { /** * @param string $roleSid The SID of the Role to assign to the member * @param int $lastConsumedMessageIndex The index of the last Message in the * Channel the Member has read * @param \DateTime $lastConsumptionTimestamp The ISO 8601 based timestamp * string representing the datetime * of the last Message read event * for the member within the Channel * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $attributes A valid JSON string that contains * application-specific data * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return CreateMemberOptions Options builder */ public static function create(string $roleSid = Values::NONE, int $lastConsumedMessageIndex = Values::NONE, \DateTime $lastConsumptionTimestamp = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, string $attributes = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE): CreateMemberOptions { return new CreateMemberOptions($roleSid, $lastConsumedMessageIndex, $lastConsumptionTimestamp, $dateCreated, $dateUpdated, $attributes, $xTwilioWebhookEnabled); } /** * @param string[] $identity The `identity` value of the resources to read * @return ReadMemberOptions Options builder */ public static function read(array $identity = Values::ARRAY_NONE): ReadMemberOptions { return new ReadMemberOptions($identity); } /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return DeleteMemberOptions Options builder */ public static function delete(string $xTwilioWebhookEnabled = Values::NONE): DeleteMemberOptions { return new DeleteMemberOptions($xTwilioWebhookEnabled); } /** * @param string $roleSid The SID of the Role to assign to the member * @param int $lastConsumedMessageIndex The index of the last consumed Message * for the Channel for the Member * @param \DateTime $lastConsumptionTimestamp The ISO 8601 based timestamp * string representing the datetime * of the last Message read event * for the Member within the Channel * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $attributes A valid JSON string that contains * application-specific data * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return UpdateMemberOptions Options builder */ public static function update(string $roleSid = Values::NONE, int $lastConsumedMessageIndex = Values::NONE, \DateTime $lastConsumptionTimestamp = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, string $attributes = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE): UpdateMemberOptions { return new UpdateMemberOptions($roleSid, $lastConsumedMessageIndex, $lastConsumptionTimestamp, $dateCreated, $dateUpdated, $attributes, $xTwilioWebhookEnabled); } } class CreateMemberOptions extends Options { /** * @param string $roleSid The SID of the Role to assign to the member * @param int $lastConsumedMessageIndex The index of the last Message in the * Channel the Member has read * @param \DateTime $lastConsumptionTimestamp The ISO 8601 based timestamp * string representing the datetime * of the last Message read event * for the member within the Channel * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $attributes A valid JSON string that contains * application-specific data * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header */ public function __construct(string $roleSid = Values::NONE, int $lastConsumedMessageIndex = Values::NONE, \DateTime $lastConsumptionTimestamp = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, 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 to assign to the member * @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 in the * Channel 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 based timestamp * string representing the datetime * of the last Message read event * for the member within the Channel * @return $this Fluent Builder */ public function setLastConsumptionTimestamp(\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 ISO 8601 date and time in GMT when the * resource was created * @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 ISO 8601 date and time in GMT when the * resource was 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 ReadMemberOptions extends Options { /** * @param string[] $identity The `identity` value of the resources to read */ 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 `identity` value of the resources to read * @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 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 UpdateMemberOptions extends Options { /** * @param string $roleSid The SID of the Role to assign to the member * @param int $lastConsumedMessageIndex The index of the last consumed Message * for the Channel for the Member * @param \DateTime $lastConsumptionTimestamp The ISO 8601 based timestamp * string representing the datetime * of the last Message read event * for the Member within the Channel * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $attributes A valid JSON string that contains * application-specific data * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header */ public function __construct(string $roleSid = Values::NONE, int $lastConsumedMessageIndex = Values::NONE, \DateTime $lastConsumptionTimestamp = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, 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 to assign to the member * @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 consumed Message * for the Channel for the Member * @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 based timestamp * string representing the datetime * of the last Message read event * for the Member within the Channel * @return $this Fluent Builder */ public function setLastConsumptionTimestamp(\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 ISO 8601 date and time in GMT when the * resource was created * @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 ISO 8601 date and time in GMT when the * resource was 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 . ']'; } } Chat/V2/Service/Channel/MemberContext.php 0000644 00000007237 15107452360 0014163 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class MemberContext extends InstanceContext { /** * Initialize the MemberContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $channelSid The SID of the channel the member belongs to * @param string $sid The SID of the Member resource to fetch */ public function __construct(Version $version, $serviceSid, $channelSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Members/' . \rawurlencode($sid) . ''; } /** * Fetch the MemberInstance * * @return MemberInstance Fetched MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MemberInstance { $payload = $this->version->fetch('GET', $this->uri); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['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(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled'], ]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * 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(['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) . ']'; } } Chat/V2/Service/Channel/WebhookList.php 0000644 00000014605 15107452360 0013636 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class WebhookList extends ListResource { /** * Construct the WebhookList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the Channel Webhook * resource is associated with * @param string $channelSid The SID of the Channel the Channel Webhook * resource belongs to */ public function __construct(Version $version, string $serviceSid, string $channelSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Webhooks'; } /** * Streams WebhookInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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); } /** * Create the WebhookInstance * * @param string $type The type of webhook * @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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new WebhookInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Constructs a WebhookContext * * @param string $sid The SID of the Channel Webhook resource to fetch */ 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]'; } } Chat/V2/Service/Channel/MessageOptions.php 0000644 00000040047 15107452360 0014343 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class MessageOptions { /** * @param string $from The Identity of the new message's author * @param string $attributes A valid JSON string that contains * application-specific data * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $lastUpdatedBy The Identity of the User who last updated the * Message * @param string $body The message to send to the channel * @param string $mediaSid The Media Sid to be attached to the new Message * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return CreateMessageOptions Options builder */ public static function create(string $from = Values::NONE, string $attributes = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, string $lastUpdatedBy = Values::NONE, string $body = Values::NONE, string $mediaSid = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE): CreateMessageOptions { return new CreateMessageOptions($from, $attributes, $dateCreated, $dateUpdated, $lastUpdatedBy, $body, $mediaSid, $xTwilioWebhookEnabled); } /** * @param string $order The sort order of the returned messages * @return ReadMessageOptions Options builder */ public static function read(string $order = Values::NONE): ReadMessageOptions { return new ReadMessageOptions($order); } /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return DeleteMessageOptions Options builder */ public static function delete(string $xTwilioWebhookEnabled = Values::NONE): DeleteMessageOptions { return new DeleteMessageOptions($xTwilioWebhookEnabled); } /** * @param string $body The message to send to the channel * @param string $attributes A valid JSON string that contains * application-specific data * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $lastUpdatedBy The Identity of the User who last updated the * Message, if applicable * @param string $from The Identity of the message's author * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return UpdateMessageOptions Options builder */ public static function update(string $body = Values::NONE, string $attributes = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, string $lastUpdatedBy = Values::NONE, string $from = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE): UpdateMessageOptions { return new UpdateMessageOptions($body, $attributes, $dateCreated, $dateUpdated, $lastUpdatedBy, $from, $xTwilioWebhookEnabled); } } class CreateMessageOptions extends Options { /** * @param string $from The Identity of the new message's author * @param string $attributes A valid JSON string that contains * application-specific data * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $lastUpdatedBy The Identity of the User who last updated the * Message * @param string $body The message to send to the channel * @param string $mediaSid The Media Sid to be attached to the new Message * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header */ public function __construct(string $from = Values::NONE, string $attributes = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, string $lastUpdatedBy = Values::NONE, string $body = Values::NONE, string $mediaSid = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE) { $this->options['from'] = $from; $this->options['attributes'] = $attributes; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['lastUpdatedBy'] = $lastUpdatedBy; $this->options['body'] = $body; $this->options['mediaSid'] = $mediaSid; $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 of the new message's author * @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 ISO 8601 date and time in GMT when the * resource was created * @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 ISO 8601 date and time in GMT when the * resource was 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 of the User who last updated the * Message * @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 * @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 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 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 ReadMessageOptions extends Options { /** * @param string $order The sort order of the returned messages */ 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 * @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 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 UpdateMessageOptions extends Options { /** * @param string $body The message to send to the channel * @param string $attributes A valid JSON string that contains * application-specific data * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $lastUpdatedBy The Identity of the User who last updated the * Message, if applicable * @param string $from The Identity of the message's author * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header */ public function __construct(string $body = Values::NONE, string $attributes = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, 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 * @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 ISO 8601 date and time in GMT when the * resource was created * @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 ISO 8601 date and time in GMT when the * resource was 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 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 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 . ']'; } } Chat/V2/Service/Channel/InviteInstance.php 0000644 00000010377 15107452360 0014331 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $channelSid * @property string $serviceSid * @property string $identity * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $roleSid * @property string $createdBy * @property string $url */ class InviteInstance extends InstanceResource { /** * Initialize the InviteInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $channelSid The SID of the Channel the new resource belongs to * @param string $sid The SID of the Invite resource to fetch */ public function __construct(Version $version, array $payload, string $serviceSid, string $channelSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the InviteInstance * * @return InviteInstance Fetched InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): InviteInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Chat/V2/Service/Channel/MessagePage.php 0000644 00000002413 15107452360 0013557 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MessagePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Chat/V2/Service/Channel/MessageList.php 0000644 00000015171 15107452360 0013623 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class MessageList extends ListResource { /** * Construct the MessageList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $channelSid The SID of the Channel the Message resource * belongs to */ public function __construct(Version $version, string $serviceSid, string $channelSid) { parent::__construct($version); // Path Solution $this->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(['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'] ); } /** * 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']); } /** * 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); } /** * Retrieve a single page of MessageInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 fetch */ 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]'; } } Chat/V2/Service/Channel/MemberList.php 0000644 00000015502 15107452360 0013444 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class MemberList extends ListResource { /** * Construct the MemberList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $channelSid The SID of the Channel for the member */ public function __construct(Version $version, string $serviceSid, string $channelSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Members'; } /** * Create the MemberInstance * * @param string $identity The `identity` value that identifies the new * resource's User * @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(['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'] ); } /** * 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']); } /** * 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); } /** * Retrieve a single page of MemberInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 fetch */ 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]'; } } Chat/V2/Service/Channel/MemberInstance.php 0000644 00000011762 15107452360 0014301 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $channelSid * @property string $serviceSid * @property string $identity * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $roleSid * @property int $lastConsumedMessageIndex * @property \DateTime $lastConsumptionTimestamp * @property string $url * @property string $attributes */ class MemberInstance extends InstanceResource { /** * Initialize the MemberInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $channelSid The SID of the Channel for the member * @param string $sid The SID of the Member resource to fetch */ public function __construct(Version $version, array $payload, string $serviceSid, string $channelSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the MemberInstance * * @return MemberInstance Fetched MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MemberInstance { return $this->proxy()->fetch(); } /** * 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); } /** * 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) . ']'; } } Chat/V2/Service/Channel/MemberPage.php 0000644 00000002405 15107452360 0013403 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MemberPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Chat/V2/Service/Channel/WebhookContext.php 0000644 00000007017 15107452360 0014346 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class WebhookContext extends InstanceContext { /** * Initialize the WebhookContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service with the Channel to fetch * the Webhook resource from * @param string $channelSid The SID of the Channel the resource to fetch * belongs to * @param string $sid The SID of the Channel Webhook resource to fetch */ public function __construct(Version $version, $serviceSid, $channelSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Webhooks/' . \rawurlencode($sid) . ''; } /** * Fetch the WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WebhookInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new WebhookInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Delete the WebhookInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Chat/V2/Service/Channel/MessageContext.php 0000644 00000007172 15107452360 0014336 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class MessageContext extends InstanceContext { /** * Initialize the MessageContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $channelSid The SID of the Channel the message to fetch * belongs to * @param string $sid The SID of the Message resource to fetch */ public function __construct(Version $version, $serviceSid, $channelSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Messages/' . \rawurlencode($sid) . ''; } /** * Fetch the MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MessageInstance { $payload = $this->version->fetch('GET', $this->uri); return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['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(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled'], ]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * 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(['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) . ']'; } } Chat/V2/Service/Channel/MessageInstance.php 0000644 00000012406 15107452360 0014452 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $attributes * @property string $serviceSid * @property string $to * @property string $channelSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $lastUpdatedBy * @property bool $wasEdited * @property string $from * @property string $body * @property int $index * @property string $type * @property array $media * @property string $url */ class MessageInstance extends InstanceResource { /** * Initialize the MessageInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $channelSid The SID of the Channel the Message resource * belongs to * @param string $sid The SID of the Message resource to fetch */ public function __construct(Version $version, array $payload, string $serviceSid, string $channelSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MessageInstance { return $this->proxy()->fetch(); } /** * 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); } /** * 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) . ']'; } } Chat/V2/Service/Channel/InviteOptions.php 0000644 00000005343 15107452360 0014215 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class InviteOptions { /** * @param string $roleSid The Role assigned to the new member * @return CreateInviteOptions Options builder */ public static function create(string $roleSid = Values::NONE): CreateInviteOptions { return new CreateInviteOptions($roleSid); } /** * @param string[] $identity The `identity` value of the resources to read * @return ReadInviteOptions Options builder */ public static function read(array $identity = Values::ARRAY_NONE): ReadInviteOptions { return new ReadInviteOptions($identity); } } class CreateInviteOptions extends Options { /** * @param string $roleSid The Role assigned to the new member */ public function __construct(string $roleSid = Values::NONE) { $this->options['roleSid'] = $roleSid; } /** * The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) assigned to the new member. * * @param string $roleSid The Role assigned to the new member * @return $this Fluent Builder */ public function setRoleSid(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 `identity` value of the resources to read */ 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 `identity` value of the resources to read * @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 . ']'; } } Chat/V2/Service/Channel/InviteList.php 0000644 00000014454 15107452360 0013500 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class InviteList extends ListResource { /** * Construct the InviteList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $channelSid The SID of the Channel the new resource belongs to */ public function __construct(Version $version, string $serviceSid, string $channelSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Invites'; } /** * Create the InviteInstance * * @param string $identity The `identity` value that identifies the new * resource's User * @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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new InviteInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Streams InviteInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of InviteInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 fetch */ 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]'; } } Chat/V2/Service/Channel/InvitePage.php 0000644 00000002405 15107452360 0013432 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class InvitePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Chat/V2/Service/Channel/InviteContext.php 0000644 00000004345 15107452360 0014207 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class InviteContext extends InstanceContext { /** * Initialize the InviteContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $channelSid The SID of the Channel the resource to fetch * belongs to * @param string $sid The SID of the Invite resource to fetch */ public function __construct(Version $version, $serviceSid, $channelSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Invites/' . \rawurlencode($sid) . ''; } /** * Fetch the InviteInstance * * @return InviteInstance Fetched InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): InviteInstance { $payload = $this->version->fetch('GET', $this->uri); return new InviteInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Delete the InviteInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Chat/V2/Service/Channel/WebhookInstance.php 0000644 00000011141 15107452360 0014457 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $channelSid * @property string $type * @property string $url * @property array $configuration * @property \DateTime $dateCreated * @property \DateTime $dateUpdated */ class WebhookInstance extends InstanceResource { /** * Initialize the WebhookInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the Channel Webhook * resource is associated with * @param string $channelSid The SID of the Channel the Channel Webhook * resource belongs to * @param string $sid The SID of the Channel Webhook resource to fetch */ public function __construct(Version $version, array $payload, string $serviceSid, string $channelSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Chat/V2/Service/Channel/WebhookOptions.php 0000644 00000033210 15107452360 0014347 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class WebhookOptions { /** * @param string $configurationUrl The URL of the webhook to call * @param string $configurationMethod The HTTP method used to call * `configuration.url` * @param string[] $configurationFilters The events that cause us to call the * Channel Webhook * @param string[] $configurationTriggers A string that will cause us to call * the webhook when it is found in a * message body * @param string $configurationFlowSid The SID of the Studio Flow to call when * an event occurs * @param int $configurationRetryCount The number of times to retry the webhook * if the first attempt fails * @return CreateWebhookOptions Options builder */ public static function create(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::NONE): CreateWebhookOptions { return new CreateWebhookOptions($configurationUrl, $configurationMethod, $configurationFilters, $configurationTriggers, $configurationFlowSid, $configurationRetryCount); } /** * @param string $configurationUrl The URL of the webhook to call * @param string $configurationMethod The HTTP method used to call * `configuration.url` * @param string[] $configurationFilters The events that cause us to call the * Channel Webhook * @param string[] $configurationTriggers A string that will cause us to call * the webhook when it is found in a * message body * @param string $configurationFlowSid The SID of the Studio Flow to call when * an event occurs * @param int $configurationRetryCount The number of times to retry the webhook * if the first attempt fails * @return UpdateWebhookOptions Options builder */ public static function update(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::NONE): UpdateWebhookOptions { return new UpdateWebhookOptions($configurationUrl, $configurationMethod, $configurationFilters, $configurationTriggers, $configurationFlowSid, $configurationRetryCount); } } class CreateWebhookOptions extends Options { /** * @param string $configurationUrl The URL of the webhook to call * @param string $configurationMethod The HTTP method used to call * `configuration.url` * @param string[] $configurationFilters The events that cause us to call the * Channel Webhook * @param string[] $configurationTriggers A string that will cause us to call * the webhook when it is found in a * message body * @param string $configurationFlowSid The SID of the Studio Flow to call when * an event occurs * @param int $configurationRetryCount The number of times to retry the webhook * if the first attempt fails */ public function __construct(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::NONE) { $this->options['configurationUrl'] = $configurationUrl; $this->options['configurationMethod'] = $configurationMethod; $this->options['configurationFilters'] = $configurationFilters; $this->options['configurationTriggers'] = $configurationTriggers; $this->options['configurationFlowSid'] = $configurationFlowSid; $this->options['configurationRetryCount'] = $configurationRetryCount; } /** * The URL of the webhook to call using the `configuration.method`. * * @param string $configurationUrl The URL of the webhook to call * @return $this Fluent Builder */ public function setConfigurationUrl(string $configurationUrl): self { $this->options['configurationUrl'] = $configurationUrl; return $this; } /** * The HTTP method used to call `configuration.url`. Can be: `GET` or `POST` and the default is `POST`. * * @param string $configurationMethod The HTTP method used to call * `configuration.url` * @return $this Fluent Builder */ public function setConfigurationMethod(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 * @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 found in a * message body * @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 to call when * an event occurs * @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 * @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 * @param string $configurationMethod The HTTP method used to call * `configuration.url` * @param string[] $configurationFilters The events that cause us to call the * Channel Webhook * @param string[] $configurationTriggers A string that will cause us to call * the webhook when it is found in a * message body * @param string $configurationFlowSid The SID of the Studio Flow to call when * an event occurs * @param int $configurationRetryCount The number of times to retry the webhook * if the first attempt fails */ public function __construct(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::NONE) { $this->options['configurationUrl'] = $configurationUrl; $this->options['configurationMethod'] = $configurationMethod; $this->options['configurationFilters'] = $configurationFilters; $this->options['configurationTriggers'] = $configurationTriggers; $this->options['configurationFlowSid'] = $configurationFlowSid; $this->options['configurationRetryCount'] = $configurationRetryCount; } /** * The URL of the webhook to call using the `configuration.method`. * * @param string $configurationUrl The URL of the webhook to call * @return $this Fluent Builder */ public function setConfigurationUrl(string $configurationUrl): self { $this->options['configurationUrl'] = $configurationUrl; return $this; } /** * The HTTP method used to call `configuration.url`. Can be: `GET` or `POST` and the default is `POST`. * * @param string $configurationMethod The HTTP method used to call * `configuration.url` * @return $this Fluent Builder */ public function setConfigurationMethod(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 * @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 found in a * message body * @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 to call when * an event occurs * @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 * @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 . ']'; } } Chat/V2/Service/UserContext.php 0000644 00000012233 15107452360 0012312 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Chat\V2\Service\User\UserBindingList; use Twilio\Rest\Chat\V2\Service\User\UserChannelList; use Twilio\Values; use Twilio\Version; /** * @property UserChannelList $userChannels * @property UserBindingList $userBindings * @method \Twilio\Rest\Chat\V2\Service\User\UserChannelContext userChannels(string $channelSid) * @method \Twilio\Rest\Chat\V2\Service\User\UserBindingContext userBindings(string $sid) */ class UserContext extends InstanceContext { protected $_userChannels; protected $_userBindings; /** * Initialize the UserContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $sid The SID of the User resource to fetch */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Users/' . \rawurlencode($sid) . ''; } /** * Fetch the UserInstance * * @return UserInstance Fetched UserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserInstance { $payload = $this->version->fetch('GET', $this->uri); return new UserInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Delete the UserInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserInstance { $options = new Values($options); $data = Values::of([ 'RoleSid' => $options['roleSid'], 'Attributes' => $options['attributes'], 'FriendlyName' => $options['friendlyName'], ]); $headers = Values::of(['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 userChannels */ protected function getUserChannels(): UserChannelList { if (!$this->_userChannels) { $this->_userChannels = new UserChannelList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_userChannels; } /** * 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; } /** * 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) . ']'; } } Chat/V2/Service/BindingPage.php 0000644 00000002242 15107452360 0012175 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class BindingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Chat/V2/Service/User/UserChannelPage.php 0000644 00000002432 15107452360 0013751 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\User; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UserChannelPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Chat/V2/Service/User/UserBindingPage.php 0000644 00000002432 15107452360 0013753 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\User; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UserBindingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Chat/V2/Service/User/UserBindingInstance.php 0000644 00000011001 15107452360 0014633 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\User; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $endpoint * @property string $identity * @property string $userSid * @property string $credentialSid * @property string $bindingType * @property string[] $messageTypes * @property string $url */ class UserBindingInstance extends InstanceResource { /** * Initialize the UserBindingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $userSid The SID of the User with the binding * @param string $sid The SID of the User Binding resource to fetch */ public function __construct(Version $version, array $payload, string $serviceSid, string $userSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the UserBindingInstance * * @return UserBindingInstance Fetched UserBindingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserBindingInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Chat/V2/Service/User/UserChannelContext.php 0000644 00000007130 15107452360 0014521 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\User; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class UserChannelContext extends InstanceContext { /** * Initialize the UserChannelContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the User Channel * resource from * @param string $userSid The SID of the User to fetch the User Channel * resource from * @param string $channelSid The SID of the Channel that has the User Channel * to fetch */ public function __construct(Version $version, $serviceSid, $userSid, $channelSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'userSid' => $userSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Users/' . \rawurlencode($userSid) . '/Channels/' . \rawurlencode($channelSid) . ''; } /** * Fetch the UserChannelInstance * * @return UserChannelInstance Fetched UserChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserChannelInstance { $payload = $this->version->fetch('GET', $this->uri); return new UserChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid'], $this->solution['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(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled'], ]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * 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']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new UserChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid'], $this->solution['channelSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.UserChannelContext ' . \implode(' ', $context) . ']'; } } Chat/V2/Service/User/UserChannelInstance.php 0000644 00000011703 15107452360 0014642 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\User; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $serviceSid * @property string $channelSid * @property string $userSid * @property string $memberSid * @property string $status * @property int $lastConsumedMessageIndex * @property int $unreadMessagesCount * @property array $links * @property string $url * @property string $notificationLevel */ class UserChannelInstance extends InstanceResource { /** * Initialize the UserChannelInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $userSid The SID of the User the User Channel belongs to * @param string $channelSid The SID of the Channel that has the User Channel * to fetch */ public function __construct(Version $version, array $payload, string $serviceSid, string $userSid, string $channelSid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the UserChannelInstance * * @return UserChannelInstance Fetched UserChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserChannelInstance { return $this->proxy()->fetch(); } /** * 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); } /** * 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) . ']'; } } Chat/V2/Service/User/UserChannelList.php 0000644 00000012176 15107452360 0014016 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\User; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class UserChannelList extends ListResource { /** * Construct the UserChannelList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $userSid The SID of the User the User Channel belongs to */ public function __construct(Version $version, string $serviceSid, string $userSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'userSid' => $userSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Users/' . \rawurlencode($userSid) . '/Channels'; } /** * Streams UserChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 that has the User Channel * to fetch */ 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]'; } } Chat/V2/Service/User/UserBindingOptions.php 0000644 00000003437 15107452360 0014540 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\User; use Twilio\Options; use Twilio\Values; abstract class UserBindingOptions { /** * @param string[] $bindingType The push technology used by the User Binding * resources to read * @return ReadUserBindingOptions Options builder */ public static function read(array $bindingType = Values::ARRAY_NONE): ReadUserBindingOptions { return new ReadUserBindingOptions($bindingType); } } class ReadUserBindingOptions extends Options { /** * @param string[] $bindingType The push technology used by the User Binding * resources to read */ public function __construct(array $bindingType = Values::ARRAY_NONE) { $this->options['bindingType'] = $bindingType; } /** * The push technology used by the User Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. * * @param string[] $bindingType The push technology used by the User Binding * resources to read * @return $this Fluent Builder */ public function setBindingType(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 . ']'; } } Chat/V2/Service/User/UserBindingContext.php 0000644 00000004315 15107452360 0014525 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\User; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class UserBindingContext extends InstanceContext { /** * Initialize the UserBindingContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $userSid The SID of the User with the binding * @param string $sid The SID of the User Binding resource to fetch */ public function __construct(Version $version, $serviceSid, $userSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'userSid' => $userSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Users/' . \rawurlencode($userSid) . '/Bindings/' . \rawurlencode($sid) . ''; } /** * Fetch the UserBindingInstance * * @return UserBindingInstance Fetched UserBindingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserBindingInstance { $payload = $this->version->fetch('GET', $this->uri); return new UserBindingInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid'], $this->solution['sid'] ); } /** * Delete the UserBindingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Chat/V2/Service/User/UserBindingList.php 0000644 00000013020 15107452360 0014005 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\User; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class UserBindingList extends ListResource { /** * Construct the UserBindingList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $userSid The SID of the User with the binding */ public function __construct(Version $version, string $serviceSid, string $userSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'userSid' => $userSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Users/' . \rawurlencode($userSid) . '/Bindings'; } /** * Streams UserBindingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of UserBindingInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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' => Serialize::map($options['bindingType'], function($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new UserBindingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserBindingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return 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 fetch */ 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]'; } } Chat/V2/Service/User/UserChannelOptions.php 0000644 00000014155 15107452360 0014535 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\User; use Twilio\Options; use Twilio\Values; abstract class UserChannelOptions { /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return DeleteUserChannelOptions Options builder */ public static function delete(string $xTwilioWebhookEnabled = Values::NONE): DeleteUserChannelOptions { return new DeleteUserChannelOptions($xTwilioWebhookEnabled); } /** * @param string $notificationLevel The push notification level to assign to * the User Channel * @param int $lastConsumedMessageIndex The index of the last Message that the * Member has read within the Channel * @param \DateTime $lastConsumptionTimestamp The ISO 8601 based timestamp * string that represents the * datetime of the last Message read * event for the Member within the * Channel * @return UpdateUserChannelOptions Options builder */ public static function update(string $notificationLevel = Values::NONE, int $lastConsumedMessageIndex = Values::NONE, \DateTime $lastConsumptionTimestamp = Values::NONE): UpdateUserChannelOptions { return new UpdateUserChannelOptions($notificationLevel, $lastConsumedMessageIndex, $lastConsumptionTimestamp); } } class DeleteUserChannelOptions 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.DeleteUserChannelOptions ' . $options . ']'; } } class UpdateUserChannelOptions extends Options { /** * @param string $notificationLevel The push notification level to assign to * the User Channel * @param int $lastConsumedMessageIndex The index of the last Message that the * Member has read within the Channel * @param \DateTime $lastConsumptionTimestamp The ISO 8601 based timestamp * string that represents the * datetime of the last Message read * event for the Member within the * Channel */ public function __construct(string $notificationLevel = Values::NONE, int $lastConsumedMessageIndex = Values::NONE, \DateTime $lastConsumptionTimestamp = Values::NONE) { $this->options['notificationLevel'] = $notificationLevel; $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; } /** * The push notification level to assign to the User Channel. Can be: `default` or `muted`. * * @param string $notificationLevel The push notification level to assign to * the User Channel * @return $this Fluent Builder */ public function setNotificationLevel(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 that the * Member has read within the Channel * @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 based timestamp * string that represents the * datetime of the last Message read * event for the Member within the * Channel * @return $this Fluent Builder */ public function setLastConsumptionTimestamp(\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 . ']'; } } Chat/V2/Service/ChannelInstance.php 0000644 00000013335 15107452360 0013070 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Chat\V2\Service\Channel\InviteList; use Twilio\Rest\Chat\V2\Service\Channel\MemberList; use Twilio\Rest\Chat\V2\Service\Channel\MessageList; use Twilio\Rest\Chat\V2\Service\Channel\WebhookList; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $friendlyName * @property string $uniqueName * @property string $attributes * @property string $type * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $createdBy * @property int $membersCount * @property int $messagesCount * @property string $url * @property array $links */ class ChannelInstance extends InstanceResource { protected $_members; protected $_messages; protected $_invites; protected $_webhooks; /** * Initialize the ChannelInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $sid The SID of the resource */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the ChannelInstance * * @return ChannelInstance Fetched ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ChannelInstance { return $this->proxy()->fetch(); } /** * 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); } /** * 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 messages */ protected function getMessages(): MessageList { return $this->proxy()->messages; } /** * Access the invites */ protected function getInvites(): InviteList { return $this->proxy()->invites; } /** * Access the webhooks */ protected function getWebhooks(): WebhookList { return $this->proxy()->webhooks; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Chat/V2/Service/ChannelContext.php 0000644 00000015171 15107452360 0012750 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Chat\V2\Service\Channel\InviteList; use Twilio\Rest\Chat\V2\Service\Channel\MemberList; use Twilio\Rest\Chat\V2\Service\Channel\MessageList; use Twilio\Rest\Chat\V2\Service\Channel\WebhookList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property MemberList $members * @property MessageList $messages * @property InviteList $invites * @property WebhookList $webhooks * @method \Twilio\Rest\Chat\V2\Service\Channel\MemberContext members(string $sid) * @method \Twilio\Rest\Chat\V2\Service\Channel\MessageContext messages(string $sid) * @method \Twilio\Rest\Chat\V2\Service\Channel\InviteContext invites(string $sid) * @method \Twilio\Rest\Chat\V2\Service\Channel\WebhookContext webhooks(string $sid) */ class ChannelContext extends InstanceContext { protected $_members; protected $_messages; protected $_invites; protected $_webhooks; /** * Initialize the ChannelContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $sid The SID of the resource */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($sid) . ''; } /** * Fetch the ChannelInstance * * @return ChannelInstance Fetched ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ChannelInstance { $payload = $this->version->fetch('GET', $this->uri); return new ChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['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(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled'], ]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * 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(['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 messages */ protected function getMessages(): MessageList { if (!$this->_messages) { $this->_messages = new MessageList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_messages; } /** * 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; } /** * 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) . ']'; } } Chat/V2/Service/UserPage.php 0000644 00000002220 15107452360 0011535 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UserPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Chat/V2/Service/RolePage.php 0000644 00000002220 15107452360 0011520 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RolePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Chat/V2/Service/RoleList.php 0000644 00000013045 15107452360 0011566 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class RoleList extends ListResource { /** * Construct the RoleList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with */ public function __construct(Version $version, string $serviceSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Roles'; } /** * Create the RoleInstance * * @param string $friendlyName A string to describe the new resource * @param string $type The type of role * @param string[] $permission A permission the role should have * @return RoleInstance 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; }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new RoleInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams RoleInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 fetch */ 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]'; } } Chat/V2/Service/BindingInstance.php 0000644 00000010373 15107452360 0013071 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $endpoint * @property string $identity * @property string $credentialSid * @property string $bindingType * @property string[] $messageTypes * @property string $url * @property array $links */ class BindingInstance extends InstanceResource { /** * Initialize the BindingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the Binding resource * is associated with * @param string $sid The SID of the resource to fetch */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the BindingInstance * * @return BindingInstance Fetched BindingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): BindingInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Chat/V2/Service/BindingList.php 0000644 00000012460 15107452360 0012237 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class BindingList extends ListResource { /** * Construct the BindingList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the Binding resource * is associated with */ public function __construct(Version $version, string $serviceSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Bindings'; } /** * Streams BindingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of BindingInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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' => Serialize::map($options['bindingType'], function($e) { return $e; }), 'Identity' => Serialize::map($options['identity'], function($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new BindingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of BindingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return 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 resource to fetch */ 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]'; } } Chat/V2/Service/UserList.php 0000644 00000013303 15107452360 0011600 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class UserList extends ListResource { /** * Construct the UserList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with */ public function __construct(Version $version, string $serviceSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Users'; } /** * Create the UserInstance * * @param string $identity The `identity` value that identifies the new * resource's User * @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(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled'], ]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new UserInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams UserInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 fetch */ 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]'; } } Chat/V2/Service/RoleContext.php 0000644 00000005157 15107452360 0012304 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class RoleContext extends InstanceContext { /** * Initialize the RoleContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $sid The SID of the Role resource to fetch */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Roles/' . \rawurlencode($sid) . ''; } /** * Fetch the RoleInstance * * @return RoleInstance Fetched RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RoleInstance { $payload = $this->version->fetch('GET', $this->uri); return new RoleInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Delete the RoleInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the RoleInstance * * @param string[] $permission A permission the role should have * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $permission): RoleInstance { $data = Values::of(['Permission' => Serialize::map($permission, function($e) { return $e; }), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new RoleInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.RoleContext ' . \implode(' ', $context) . ']'; } } Chat/V2/Service/RoleInstance.php 0000644 00000010375 15107452360 0012422 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $friendlyName * @property string $type * @property string[] $permissions * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class RoleInstance extends InstanceResource { /** * Initialize the RoleInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $sid The SID of the Role resource to fetch */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the RoleInstance * * @return RoleInstance Fetched RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RoleInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Update the RoleInstance * * @param string[] $permission A permission the role should have * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(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) . ']'; } } Chat/V2/ServiceInstance.php 0000644 00000015121 15107452360 0011513 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Chat\V2\Service\BindingList; use Twilio\Rest\Chat\V2\Service\ChannelList; use Twilio\Rest\Chat\V2\Service\RoleList; use Twilio\Rest\Chat\V2\Service\UserList; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $defaultServiceRoleSid * @property string $defaultChannelRoleSid * @property string $defaultChannelCreatorRoleSid * @property bool $readStatusEnabled * @property bool $reachabilityEnabled * @property int $typingIndicatorTimeout * @property int $consumptionReportInterval * @property array $limits * @property string $preWebhookUrl * @property string $postWebhookUrl * @property string $webhookMethod * @property string[] $webhookFilters * @property int $preWebhookRetryCount * @property int $postWebhookRetryCount * @property array $notifications * @property array $media * @property string $url * @property array $links */ class ServiceInstance extends InstanceResource { protected $_channels; protected $_roles; protected $_users; protected $_bindings; /** * Initialize the ServiceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the Service resource to fetch */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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; } /** * 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.Chat.V2.ServiceInstance ' . \implode(' ', $context) . ']'; } } Chat/V2/ServiceList.php 0000644 00000012036 15107452360 0010664 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ServiceList extends ListResource { /** * Construct the ServiceList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Services'; } /** * Create the ServiceInstance * * @param string $friendlyName A string to describe the resource * @return ServiceInstance Created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName): ServiceInstance { $data = Values::of(['FriendlyName' => $friendlyName, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ServiceInstance($this->version, $payload); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 fetch */ 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]'; } } Chat/V2/ServiceContext.php 0000644 00000017662 15107452360 0011407 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Chat\V2\Service\BindingList; use Twilio\Rest\Chat\V2\Service\ChannelList; use Twilio\Rest\Chat\V2\Service\RoleList; use Twilio\Rest\Chat\V2\Service\UserList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property ChannelList $channels * @property RoleList $roles * @property UserList $users * @property BindingList $bindings * @method \Twilio\Rest\Chat\V2\Service\ChannelContext channels(string $sid) * @method \Twilio\Rest\Chat\V2\Service\RoleContext roles(string $sid) * @method \Twilio\Rest\Chat\V2\Service\UserContext users(string $sid) * @method \Twilio\Rest\Chat\V2\Service\BindingContext bindings(string $sid) */ class ServiceContext extends InstanceContext { protected $_channels; protected $_roles; protected $_users; protected $_bindings; /** * Initialize the ServiceContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the Service resource to fetch */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($sid) . ''; } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { $payload = $this->version->fetch('GET', $this->uri); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(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']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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; } /** * 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.Chat.V2.ServiceContext ' . \implode(' ', $context) . ']'; } } Chat/V2/CredentialContext.php 0000644 00000005242 15107452360 0012050 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class CredentialContext extends InstanceContext { /** * Initialize the CredentialContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the Credential resource to fetch */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Credentials/' . \rawurlencode($sid) . ''; } /** * Fetch the CredentialInstance * * @return CredentialInstance Fetched CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new CredentialInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the CredentialInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Chat/V2/CredentialList.php 0000644 00000013173 15107452360 0011341 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class CredentialList extends ListResource { /** * Construct the CredentialList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Credentials'; } /** * Streams CredentialInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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); } /** * Create the CredentialInstance * * @param string $type The type of push-notification service the credential is * for * @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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CredentialInstance($this->version, $payload); } /** * Constructs a CredentialContext * * @param string $sid The SID of the Credential resource to fetch */ 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]'; } } Chat/V2/CredentialInstance.php 0000644 00000007737 15107452360 0012203 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $friendlyName * @property string $type * @property string $sandbox * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class CredentialInstance extends InstanceResource { /** * Initialize the CredentialInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the Credential resource to fetch */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Chat/V2/ServiceOptions.php 0000644 00000113234 15107452360 0011406 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2; use Twilio\Options; use Twilio\Values; abstract class ServiceOptions { /** * @param string $friendlyName A string to describe the resource * @param string $defaultServiceRoleSid The service role assigned to users when * they are added to the service * @param string $defaultChannelRoleSid The channel role assigned to users when * they are added to a channel * @param string $defaultChannelCreatorRoleSid The channel role assigned to a * channel creator when they join a * new channel * @param bool $readStatusEnabled Whether to enable the Message Consumption * Horizon feature * @param bool $reachabilityEnabled Whether to enable the Reachability * Indicator feature for this Service instance * @param int $typingIndicatorTimeout How long in seconds to wait before * assuming the user is no longer typing * @param int $consumptionReportInterval DEPRECATED * @param bool $notificationsNewMessageEnabled Whether to send a notification * when a new message is added to a * channel * @param string $notificationsNewMessageTemplate The template to use to create * the notification text * displayed when a new message * is added to a channel * @param string $notificationsNewMessageSound The name of the sound to play * when a new message is added to a * channel * @param bool $notificationsNewMessageBadgeCountEnabled Whether the new * message badge is * enabled * @param bool $notificationsAddedToChannelEnabled Whether to send a * notification when a member * is added to a channel * @param string $notificationsAddedToChannelTemplate The template to use to * create the notification * text displayed when a * member is added to a * channel * @param string $notificationsAddedToChannelSound The name of the sound to * play when a member is added * to a channel * @param bool $notificationsRemovedFromChannelEnabled Whether to send a * notification to a user * when they are removed * from a channel * @param string $notificationsRemovedFromChannelTemplate The template to use * to create the * notification text * displayed to a user * when they are removed * @param string $notificationsRemovedFromChannelSound The name of the sound to * play to a user when they * are removed from a * channel * @param bool $notificationsInvitedToChannelEnabled Whether to send a * notification when a user * is invited to a channel * @param string $notificationsInvitedToChannelTemplate The template to use to * create the notification * text displayed when a * user is invited to a * channel * @param string $notificationsInvitedToChannelSound The name of the sound to * play when a user is * invited to a channel * @param string $preWebhookUrl The webhook URL for pre-event webhooks * @param string $postWebhookUrl The URL for post-event webhooks * @param string $webhookMethod The HTTP method to use for both PRE and POST * webhooks * @param string[] $webhookFilters The list of webhook events that are enabled * for this Service instance * @param int $limitsChannelMembers The maximum number of Members that can be * added to Channels within this Service * @param int $limitsUserChannels The maximum number of Channels Users can be a * Member of within this Service * @param string $mediaCompatibilityMessage The message to send when a media * message has no text * @param int $preWebhookRetryCount Count of times webhook will be retried in * case of timeout or 429/503/504 HTTP * responses * @param int $postWebhookRetryCount The number of times calls to the * `post_webhook_url` will be retried * @param bool $notificationsLogEnabled Whether to log notifications * @return UpdateServiceOptions Options builder */ public static function update(string $friendlyName = Values::NONE, string $defaultServiceRoleSid = Values::NONE, string $defaultChannelRoleSid = Values::NONE, string $defaultChannelCreatorRoleSid = Values::NONE, bool $readStatusEnabled = Values::NONE, bool $reachabilityEnabled = Values::NONE, int $typingIndicatorTimeout = Values::NONE, int $consumptionReportInterval = Values::NONE, bool $notificationsNewMessageEnabled = Values::NONE, string $notificationsNewMessageTemplate = Values::NONE, string $notificationsNewMessageSound = Values::NONE, bool $notificationsNewMessageBadgeCountEnabled = Values::NONE, bool $notificationsAddedToChannelEnabled = Values::NONE, string $notificationsAddedToChannelTemplate = Values::NONE, string $notificationsAddedToChannelSound = Values::NONE, bool $notificationsRemovedFromChannelEnabled = Values::NONE, string $notificationsRemovedFromChannelTemplate = Values::NONE, string $notificationsRemovedFromChannelSound = Values::NONE, bool $notificationsInvitedToChannelEnabled = Values::NONE, string $notificationsInvitedToChannelTemplate = Values::NONE, string $notificationsInvitedToChannelSound = Values::NONE, string $preWebhookUrl = Values::NONE, string $postWebhookUrl = Values::NONE, string $webhookMethod = Values::NONE, array $webhookFilters = Values::ARRAY_NONE, int $limitsChannelMembers = Values::NONE, int $limitsUserChannels = Values::NONE, string $mediaCompatibilityMessage = Values::NONE, int $preWebhookRetryCount = Values::NONE, int $postWebhookRetryCount = Values::NONE, bool $notificationsLogEnabled = Values::NONE): UpdateServiceOptions { return new UpdateServiceOptions($friendlyName, $defaultServiceRoleSid, $defaultChannelRoleSid, $defaultChannelCreatorRoleSid, $readStatusEnabled, $reachabilityEnabled, $typingIndicatorTimeout, $consumptionReportInterval, $notificationsNewMessageEnabled, $notificationsNewMessageTemplate, $notificationsNewMessageSound, $notificationsNewMessageBadgeCountEnabled, $notificationsAddedToChannelEnabled, $notificationsAddedToChannelTemplate, $notificationsAddedToChannelSound, $notificationsRemovedFromChannelEnabled, $notificationsRemovedFromChannelTemplate, $notificationsRemovedFromChannelSound, $notificationsInvitedToChannelEnabled, $notificationsInvitedToChannelTemplate, $notificationsInvitedToChannelSound, $preWebhookUrl, $postWebhookUrl, $webhookMethod, $webhookFilters, $limitsChannelMembers, $limitsUserChannels, $mediaCompatibilityMessage, $preWebhookRetryCount, $postWebhookRetryCount, $notificationsLogEnabled); } } class UpdateServiceOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $defaultServiceRoleSid The service role assigned to users when * they are added to the service * @param string $defaultChannelRoleSid The channel role assigned to users when * they are added to a channel * @param string $defaultChannelCreatorRoleSid The channel role assigned to a * channel creator when they join a * new channel * @param bool $readStatusEnabled Whether to enable the Message Consumption * Horizon feature * @param bool $reachabilityEnabled Whether to enable the Reachability * Indicator feature for this Service instance * @param int $typingIndicatorTimeout How long in seconds to wait before * assuming the user is no longer typing * @param int $consumptionReportInterval DEPRECATED * @param bool $notificationsNewMessageEnabled Whether to send a notification * when a new message is added to a * channel * @param string $notificationsNewMessageTemplate The template to use to create * the notification text * displayed when a new message * is added to a channel * @param string $notificationsNewMessageSound The name of the sound to play * when a new message is added to a * channel * @param bool $notificationsNewMessageBadgeCountEnabled Whether the new * message badge is * enabled * @param bool $notificationsAddedToChannelEnabled Whether to send a * notification when a member * is added to a channel * @param string $notificationsAddedToChannelTemplate The template to use to * create the notification * text displayed when a * member is added to a * channel * @param string $notificationsAddedToChannelSound The name of the sound to * play when a member is added * to a channel * @param bool $notificationsRemovedFromChannelEnabled Whether to send a * notification to a user * when they are removed * from a channel * @param string $notificationsRemovedFromChannelTemplate The template to use * to create the * notification text * displayed to a user * when they are removed * @param string $notificationsRemovedFromChannelSound The name of the sound to * play to a user when they * are removed from a * channel * @param bool $notificationsInvitedToChannelEnabled Whether to send a * notification when a user * is invited to a channel * @param string $notificationsInvitedToChannelTemplate The template to use to * create the notification * text displayed when a * user is invited to a * channel * @param string $notificationsInvitedToChannelSound The name of the sound to * play when a user is * invited to a channel * @param string $preWebhookUrl The webhook URL for pre-event webhooks * @param string $postWebhookUrl The URL for post-event webhooks * @param string $webhookMethod The HTTP method to use for both PRE and POST * webhooks * @param string[] $webhookFilters The list of webhook events that are enabled * for this Service instance * @param int $limitsChannelMembers The maximum number of Members that can be * added to Channels within this Service * @param int $limitsUserChannels The maximum number of Channels Users can be a * Member of within this Service * @param string $mediaCompatibilityMessage The message to send when a media * message has no text * @param int $preWebhookRetryCount Count of times webhook will be retried in * case of timeout or 429/503/504 HTTP * responses * @param int $postWebhookRetryCount The number of times calls to the * `post_webhook_url` will be retried * @param bool $notificationsLogEnabled Whether to log notifications */ public function __construct(string $friendlyName = Values::NONE, string $defaultServiceRoleSid = Values::NONE, string $defaultChannelRoleSid = Values::NONE, string $defaultChannelCreatorRoleSid = Values::NONE, bool $readStatusEnabled = Values::NONE, bool $reachabilityEnabled = Values::NONE, int $typingIndicatorTimeout = Values::NONE, int $consumptionReportInterval = Values::NONE, bool $notificationsNewMessageEnabled = Values::NONE, string $notificationsNewMessageTemplate = Values::NONE, string $notificationsNewMessageSound = Values::NONE, bool $notificationsNewMessageBadgeCountEnabled = Values::NONE, bool $notificationsAddedToChannelEnabled = Values::NONE, string $notificationsAddedToChannelTemplate = Values::NONE, string $notificationsAddedToChannelSound = Values::NONE, bool $notificationsRemovedFromChannelEnabled = Values::NONE, string $notificationsRemovedFromChannelTemplate = Values::NONE, string $notificationsRemovedFromChannelSound = Values::NONE, bool $notificationsInvitedToChannelEnabled = Values::NONE, string $notificationsInvitedToChannelTemplate = Values::NONE, string $notificationsInvitedToChannelSound = Values::NONE, string $preWebhookUrl = Values::NONE, string $postWebhookUrl = Values::NONE, string $webhookMethod = Values::NONE, array $webhookFilters = Values::ARRAY_NONE, int $limitsChannelMembers = Values::NONE, int $limitsUserChannels = Values::NONE, string $mediaCompatibilityMessage = Values::NONE, int $preWebhookRetryCount = Values::NONE, int $postWebhookRetryCount = Values::NONE, bool $notificationsLogEnabled = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; $this->options['readStatusEnabled'] = $readStatusEnabled; $this->options['reachabilityEnabled'] = $reachabilityEnabled; $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; $this->options['consumptionReportInterval'] = $consumptionReportInterval; $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; $this->options['notificationsNewMessageSound'] = $notificationsNewMessageSound; $this->options['notificationsNewMessageBadgeCountEnabled'] = $notificationsNewMessageBadgeCountEnabled; $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; $this->options['notificationsAddedToChannelSound'] = $notificationsAddedToChannelSound; $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; $this->options['notificationsRemovedFromChannelSound'] = $notificationsRemovedFromChannelSound; $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; $this->options['notificationsInvitedToChannelSound'] = $notificationsInvitedToChannelSound; $this->options['preWebhookUrl'] = $preWebhookUrl; $this->options['postWebhookUrl'] = $postWebhookUrl; $this->options['webhookMethod'] = $webhookMethod; $this->options['webhookFilters'] = $webhookFilters; $this->options['limitsChannelMembers'] = $limitsChannelMembers; $this->options['limitsUserChannels'] = $limitsUserChannels; $this->options['mediaCompatibilityMessage'] = $mediaCompatibilityMessage; $this->options['preWebhookRetryCount'] = $preWebhookRetryCount; $this->options['postWebhookRetryCount'] = $postWebhookRetryCount; $this->options['notificationsLogEnabled'] = $notificationsLogEnabled; } /** * A descriptive string that you create to describe the resource. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName(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 * @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 * @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 * @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 feature * @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 feature for this Service instance * @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 to wait before * assuming the user is no longer typing * @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 * @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 * @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 * @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 * @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 * @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 * @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 * @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 * @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 * @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 * @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 * @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 * @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 * @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 * @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 webhook URL for pre-event webhooks * @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 * @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 both PRE and POST * webhooks * @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 * @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 * @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 * @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 * @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 Count of times webhook will be retried in * case of timeout or 429/503/504 HTTP * responses * @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 calls to the * `post_webhook_url` will 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 * @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 . ']'; } } Chat/V2/ServicePage.php 0000644 00000002163 15107452360 0010625 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ServicePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Chat/V2.php 0000644 00000005037 15107452360 0006433 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Chat\V2\CredentialList; use Twilio\Rest\Chat\V2\ServiceList; use Twilio\Version; /** * @property CredentialList $credentials * @property ServiceList $services * @method \Twilio\Rest\Chat\V2\CredentialContext credentials(string $sid) * @method \Twilio\Rest\Chat\V2\ServiceContext services(string $sid) */ class V2 extends Version { protected $_credentials; protected $_services; /** * Construct the V2 version of Chat * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->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]'; } } Chat/V3.php 0000644 00000004252 15107452360 0006432 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Chat\V3\ChannelList; use Twilio\Version; /** * @property ChannelList $channels * @method \Twilio\Rest\Chat\V3\ChannelContext channels(string $serviceSid, string $sid) */ class V3 extends Version { protected $_channels; /** * Construct the V3 version of Chat * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->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]'; } } Autopilot.php 0000644 00000005375 15107452360 0007252 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Autopilot\V1; /** * @property \Twilio\Rest\Autopilot\V1 $v1 * @property \Twilio\Rest\Autopilot\V1\AssistantList $assistants * @property \Twilio\Rest\Autopilot\V1\RestoreAssistantList $restoreAssistant * @method \Twilio\Rest\Autopilot\V1\AssistantContext assistants(string $sid) */ class Autopilot extends Domain { protected $_v1; /** * Construct the Autopilot Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://autopilot.twilio.com'; } /** * @return V1 Version v1 of autopilot */ 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); } protected function getAssistants(): \Twilio\Rest\Autopilot\V1\AssistantList { return $this->v1->assistants; } /** * @param string $sid The unique string that identifies the resource */ protected function contextAssistants(string $sid): \Twilio\Rest\Autopilot\V1\AssistantContext { return $this->v1->assistants($sid); } protected function getRestoreAssistant(): \Twilio\Rest\Autopilot\V1\RestoreAssistantList { return $this->v1->restoreAssistant; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Autopilot]'; } } Accounts/V1/CredentialPage.php 0000644 00000002221 15107452360 0012171 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CredentialPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Accounts/V1/SecondaryAuthTokenContext.php 0000644 00000003322 15107452360 0014444 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class SecondaryAuthTokenContext extends InstanceContext { /** * Initialize the SecondaryAuthTokenContext * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/AuthTokens/Secondary'; } /** * Create the SecondaryAuthTokenInstance * * @return SecondaryAuthTokenInstance Created SecondaryAuthTokenInstance * @throws TwilioException When an HTTP error occurs. */ public function create(): SecondaryAuthTokenInstance { $payload = $this->version->create('POST', $this->uri); 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 { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Accounts/V1/AuthTokenPromotionPage.php 0000644 00000002301 15107452360 0013727 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AuthTokenPromotionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Accounts/V1/AuthTokenPromotionList.php 0000644 00000001701 15107452360 0013771 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1; use Twilio\ListResource; use Twilio\Version; class AuthTokenPromotionList extends ListResource { /** * Construct the AuthTokenPromotionList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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]'; } } Accounts/V1/SecondaryAuthTokenInstance.php 0000644 00000006476 15107452360 0014601 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $secondaryAuthToken * @property string $url */ class SecondaryAuthTokenInstance extends InstanceResource { /** * Initialize the SecondaryAuthTokenInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Accounts/V1/SecondaryAuthTokenList.php 0000644 00000001701 15107452360 0013732 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1; use Twilio\ListResource; use Twilio\Version; class SecondaryAuthTokenList extends ListResource { /** * Construct the SecondaryAuthTokenList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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]'; } } Accounts/V1/CredentialList.php 0000644 00000005347 15107452360 0012244 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Accounts\V1\Credential\AwsList; use Twilio\Rest\Accounts\V1\Credential\PublicKeyList; use Twilio\Version; /** * @property PublicKeyList $publicKey * @property AwsList $aws * @method \Twilio\Rest\Accounts\V1\Credential\PublicKeyContext publicKey(string $sid) * @method \Twilio\Rest\Accounts\V1\Credential\AwsContext aws(string $sid) */ class CredentialList extends ListResource { protected $_publicKey = null; protected $_aws = null; /** * Construct the CredentialList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; } /** * Access the publicKey */ protected function getPublicKey(): PublicKeyList { if (!$this->_publicKey) { $this->_publicKey = new PublicKeyList($this->version); } return $this->_publicKey; } /** * Access the aws */ protected function getAws(): AwsList { if (!$this->_aws) { $this->_aws = new AwsList($this->version); } return $this->_aws; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(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]'; } } Accounts/V1/CredentialInstance.php 0000644 00000002652 15107452360 0013071 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; class CredentialInstance extends InstanceResource { /** * Initialize the CredentialInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); $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.CredentialInstance]'; } } Accounts/V1/AuthTokenPromotionInstance.php 0000644 00000006022 15107452360 0014623 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $authToken * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class AuthTokenPromotionInstance extends InstanceResource { /** * Initialize the AuthTokenPromotionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Accounts/V1/Credential/PublicKeyContext.php 0000644 00000004576 15107452360 0014647 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1\Credential; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class PublicKeyContext extends InstanceContext { /** * Initialize the PublicKeyContext * * @param Version $version Version that contains the resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Credentials/PublicKeys/' . \rawurlencode($sid) . ''; } /** * Fetch the PublicKeyInstance * * @return PublicKeyInstance Fetched PublicKeyInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PublicKeyInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new PublicKeyInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the PublicKeyInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Accounts/V1/Credential/AwsOptions.php 0000644 00000006771 15107452360 0013520 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1\Credential; use Twilio\Options; use Twilio\Values; abstract class AwsOptions { /** * @param string $friendlyName A string to describe the resource * @param string $accountSid The Subaccount this Credential should be * associated with. * @return CreateAwsOptions Options builder */ public static function create(string $friendlyName = Values::NONE, string $accountSid = Values::NONE): CreateAwsOptions { return new CreateAwsOptions($friendlyName, $accountSid); } /** * @param string $friendlyName A string to describe the resource * @return UpdateAwsOptions Options builder */ public static function update(string $friendlyName = Values::NONE): UpdateAwsOptions { return new UpdateAwsOptions($friendlyName); } } class CreateAwsOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $accountSid The Subaccount this Credential should be * associated with. */ public function __construct(string $friendlyName = Values::NONE, string $accountSid = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['accountSid'] = $accountSid; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName(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 Subaccount this Credential should be * associated with. * @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 string to describe the resource */ 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 string to describe the resource * @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 . ']'; } } Accounts/V1/Credential/AwsPage.php 0000644 00000002175 15107452360 0012733 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1\Credential; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AwsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Accounts/V1/Credential/AwsList.php 0000644 00000012564 15107452360 0012775 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1\Credential; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class AwsList extends ListResource { /** * Construct the AwsList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Credentials/AWS'; } /** * Streams AwsInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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); } /** * Create the AwsInstance * * @param string $credentials A string that contains the AWS access credentials * in the format * <AWS_ACCESS_KEY_ID>:<AWS_SECRET_ACCESS_KEY> * @param array|Options $options Optional Arguments * @return AwsInstance 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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AwsInstance($this->version, $payload); } /** * Constructs a AwsContext * * @param string $sid The unique string that identifies the resource */ 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]'; } } Accounts/V1/Credential/PublicKeyList.php 0000644 00000012602 15107452360 0014123 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1\Credential; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class PublicKeyList extends ListResource { /** * Construct the PublicKeyList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Credentials/PublicKeys'; } /** * Streams PublicKeyInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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); } /** * Create the PublicKeyInstance * * @param string $publicKey A URL encoded representation of the 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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new PublicKeyInstance($this->version, $payload); } /** * Constructs a PublicKeyContext * * @param string $sid The unique string that identifies the resource */ 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]'; } } Accounts/V1/Credential/AwsInstance.php 0000644 00000007322 15107452360 0013622 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1\Credential; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class AwsInstance extends InstanceResource { /** * Initialize the AwsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Accounts/V1/Credential/AwsContext.php 0000644 00000004443 15107452360 0013503 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1\Credential; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class AwsContext extends InstanceContext { /** * Initialize the AwsContext * * @param Version $version Version that contains the resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Credentials/AWS/' . \rawurlencode($sid) . ''; } /** * Fetch the AwsInstance * * @return AwsInstance Fetched AwsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AwsInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new AwsInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the AwsInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Accounts/V1/Credential/PublicKeyInstance.php 0000644 00000007462 15107452360 0014764 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1\Credential; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class PublicKeyInstance extends InstanceResource { /** * Initialize the PublicKeyInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Accounts/V1/Credential/PublicKeyOptions.php 0000644 00000007072 15107452360 0014650 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1\Credential; use Twilio\Options; use Twilio\Values; abstract class PublicKeyOptions { /** * @param string $friendlyName A string to describe the resource * @param string $accountSid The Subaccount this Credential should be * associated with. * @return CreatePublicKeyOptions Options builder */ public static function create(string $friendlyName = Values::NONE, string $accountSid = Values::NONE): CreatePublicKeyOptions { return new CreatePublicKeyOptions($friendlyName, $accountSid); } /** * @param string $friendlyName A string to describe the resource * @return UpdatePublicKeyOptions Options builder */ public static function update(string $friendlyName = Values::NONE): UpdatePublicKeyOptions { return new UpdatePublicKeyOptions($friendlyName); } } class CreatePublicKeyOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $accountSid The Subaccount this Credential should be * associated with. */ public function __construct(string $friendlyName = Values::NONE, string $accountSid = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['accountSid'] = $accountSid; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName(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 Subaccount this Credential should be * associated with. * @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 string to describe the resource */ 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 string to describe the resource * @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 . ']'; } } Accounts/V1/Credential/PublicKeyPage.php 0000644 00000002241 15107452360 0014062 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1\Credential; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class PublicKeyPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Accounts/V1/AuthTokenPromotionContext.php 0000644 00000002654 15107452360 0014512 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class AuthTokenPromotionContext extends InstanceContext { /** * Initialize the AuthTokenPromotionContext * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/AuthTokens/Promote'; } /** * Update the AuthTokenPromotionInstance * * @return AuthTokenPromotionInstance Updated AuthTokenPromotionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(): AuthTokenPromotionInstance { $payload = $this->version->update('POST', $this->uri); 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) . ']'; } } Accounts/V1/SecondaryAuthTokenPage.php 0000644 00000002301 15107452360 0013670 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SecondaryAuthTokenPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Accounts/V1.php 0000644 00000005627 15107452360 0007337 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Accounts\V1\AuthTokenPromotionList; use Twilio\Rest\Accounts\V1\CredentialList; use Twilio\Rest\Accounts\V1\SecondaryAuthTokenList; use Twilio\Version; /** * @property AuthTokenPromotionList $authTokenPromotion * @property CredentialList $credentials * @property SecondaryAuthTokenList $secondaryAuthToken */ class V1 extends Version { protected $_authTokenPromotion; protected $_credentials; protected $_secondaryAuthToken; /** * Construct the V1 version of Accounts * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->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 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]'; } } Media.php 0000644 00000007116 15107452360 0006304 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Media\V1; /** * @property \Twilio\Rest\Media\V1 $v1 * @property \Twilio\Rest\Media\V1\MediaProcessorList $mediaProcessor * @property \Twilio\Rest\Media\V1\MediaRecordingList $mediaRecording * @property \Twilio\Rest\Media\V1\PlayerStreamerList $playerStreamer * @method \Twilio\Rest\Media\V1\MediaProcessorContext mediaProcessor(string $sid) * @method \Twilio\Rest\Media\V1\MediaRecordingContext mediaRecording(string $sid) * @method \Twilio\Rest\Media\V1\PlayerStreamerContext playerStreamer(string $sid) */ class Media extends Domain { protected $_v1; /** * Construct the Media Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://media.twilio.com'; } /** * @return V1 Version v1 of media */ 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); } protected function getMediaProcessor(): \Twilio\Rest\Media\V1\MediaProcessorList { return $this->v1->mediaProcessor; } /** * @param string $sid The SID that identifies the resource to fetch */ protected function contextMediaProcessor(string $sid): \Twilio\Rest\Media\V1\MediaProcessorContext { return $this->v1->mediaProcessor($sid); } protected function getMediaRecording(): \Twilio\Rest\Media\V1\MediaRecordingList { return $this->v1->mediaRecording; } /** * @param string $sid The SID that identifies the resource to fetch */ protected function contextMediaRecording(string $sid): \Twilio\Rest\Media\V1\MediaRecordingContext { return $this->v1->mediaRecording($sid); } protected function getPlayerStreamer(): \Twilio\Rest\Media\V1\PlayerStreamerList { return $this->v1->playerStreamer; } /** * @param string $sid The SID that identifies the resource to fetch */ protected function contextPlayerStreamer(string $sid): \Twilio\Rest\Media\V1\PlayerStreamerContext { return $this->v1->playerStreamer($sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Media]'; } } Voice/V1/SourceIpMappingPage.php 0000644 00000002246 15107452360 0012461 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SourceIpMappingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Voice/V1/ConnectionPolicyOptions.php 0000644 00000005505 15107452360 0013453 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1; use Twilio\Options; use Twilio\Values; abstract class ConnectionPolicyOptions { /** * @param string $friendlyName A string to describe the resource * @return CreateConnectionPolicyOptions Options builder */ public static function create(string $friendlyName = Values::NONE): CreateConnectionPolicyOptions { return new CreateConnectionPolicyOptions($friendlyName); } /** * @param string $friendlyName A string to describe the resource * @return UpdateConnectionPolicyOptions Options builder */ public static function update(string $friendlyName = Values::NONE): UpdateConnectionPolicyOptions { return new UpdateConnectionPolicyOptions($friendlyName); } } class CreateConnectionPolicyOptions extends Options { /** * @param string $friendlyName A string to describe the resource */ 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 string to describe the resource * @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 string to describe the resource */ 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 string to describe the resource * @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 . ']'; } } Voice/V1/DialingPermissionsList.php 0000644 00000006741 15107452360 0013262 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Voice\V1\DialingPermissions\BulkCountryUpdateList; use Twilio\Rest\Voice\V1\DialingPermissions\CountryList; use Twilio\Rest\Voice\V1\DialingPermissions\SettingsList; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property CountryList $countries * @property SettingsList $settings * @property BulkCountryUpdateList $bulkCountryUpdates * @method \Twilio\Rest\Voice\V1\DialingPermissions\CountryContext countries(string $isoCode) * @method \Twilio\Rest\Voice\V1\DialingPermissions\SettingsContext settings() */ class DialingPermissionsList extends ListResource { protected $_countries = null; protected $_settings = null; protected $_bulkCountryUpdates = null; /** * Construct the DialingPermissionsList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; } /** * 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; } /** * Access the bulkCountryUpdates */ protected function getBulkCountryUpdates(): BulkCountryUpdateList { if (!$this->_bulkCountryUpdates) { $this->_bulkCountryUpdates = new BulkCountryUpdateList($this->version); } return $this->_bulkCountryUpdates; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(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]'; } } Voice/V1/SourceIpMappingInstance.php 0000644 00000007622 15107452360 0013354 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $ipRecordSid * @property string $sipDomainSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class SourceIpMappingInstance extends InstanceResource { /** * Initialize the SourceIpMappingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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 unique string that identifies a SIP Domain * @return SourceIpMappingInstance Updated SourceIpMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $sipDomainSid): SourceIpMappingInstance { return $this->proxy()->update($sipDomainSid); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Voice/V1/ConnectionPolicyContext.php 0000644 00000010153 15107452360 0013437 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Voice\V1\ConnectionPolicy\ConnectionPolicyTargetList; use Twilio\Values; use Twilio\Version; /** * @property ConnectionPolicyTargetList $targets * @method \Twilio\Rest\Voice\V1\ConnectionPolicy\ConnectionPolicyTargetContext targets(string $sid) */ class ConnectionPolicyContext extends InstanceContext { protected $_targets; /** * Initialize the ConnectionPolicyContext * * @param Version $version Version that contains the resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/ConnectionPolicies/' . \rawurlencode($sid) . ''; } /** * Fetch the ConnectionPolicyInstance * * @return ConnectionPolicyInstance Fetched ConnectionPolicyInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ConnectionPolicyInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ConnectionPolicyInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the ConnectionPolicyInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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) . ']'; } } Voice/V1/DialingPermissionsInstance.php 0000644 00000003207 15107452360 0014105 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DialingPermissionsInstance extends InstanceResource { /** * Initialize the DialingPermissionsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); $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.DialingPermissionsInstance]'; } } Voice/V1/ArchivedCallInstance.php 0000644 00000006246 15107452360 0012631 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property \DateTime $date * @property string $sid * @property string $url */ class ArchivedCallInstance extends InstanceResource { /** * Initialize the ArchivedCallInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param \DateTime $date The date of the Call in UTC. * @param string $sid The unique string that identifies this resource */ public function __construct(Version $version, array $payload, \DateTime $date = null, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'date' => Deserialize::dateTime(Values::array_get($payload, 'date')), 'sid' => Values::array_get($payload, 'sid'), 'url' => Values::array_get($payload, 'url'), ]; $this->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) . ']'; } } Voice/V1/ConnectionPolicyInstance.php 0000644 00000010343 15107452360 0013560 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\Voice\V1\ConnectionPolicy\ConnectionPolicyTargetList; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $sid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class ConnectionPolicyInstance extends InstanceResource { protected $_targets; /** * Initialize the ConnectionPolicyInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * 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) . ']'; } } Voice/V1/ArchivedCallList.php 0000644 00000002275 15107452360 0011776 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ArchivedCallList extends ListResource { /** * Construct the ArchivedCallList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; } /** * Constructs a ArchivedCallContext * * @param \DateTime $date The date of the Call in UTC. * @param string $sid The unique string that identifies this resource */ 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]'; } } Voice/V1/IpRecordContext.php 0000644 00000004522 15107452360 0011672 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class IpRecordContext extends InstanceContext { /** * Initialize the IpRecordContext * * @param Version $version Version that contains the resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/IpRecords/' . \rawurlencode($sid) . ''; } /** * Fetch the IpRecordInstance * * @return IpRecordInstance Fetched IpRecordInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): IpRecordInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new IpRecordInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the IpRecordInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Voice/V1/ConnectionPolicyList.php 0000644 00000012503 15107452360 0012727 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ConnectionPolicyList extends ListResource { /** * Construct the ConnectionPolicyList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ConnectionPolicyInstance($this->version, $payload); } /** * 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']); } /** * 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); } /** * 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 identifies the resource */ 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]'; } } Voice/V1/DialingPermissionsPage.php 0000644 00000002603 15107452360 0013214 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DialingPermissionsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Voice/V1/IpRecordList.php 0000644 00000012536 15107452360 0011165 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class IpRecordList extends ListResource { /** * Construct the IpRecordList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new IpRecordInstance($this->version, $payload); } /** * 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']); } /** * 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); } /** * 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 unique string that identifies the resource */ 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]'; } } Voice/V1/ByocTrunkInstance.php 0000644 00000011544 15107452360 0012225 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $sid * @property string $friendlyName * @property string $voiceUrl * @property string $voiceMethod * @property string $voiceFallbackUrl * @property string $voiceFallbackMethod * @property string $statusCallbackUrl * @property string $statusCallbackMethod * @property bool $cnamLookupEnabled * @property string $connectionPolicySid * @property string $fromDomainSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class ByocTrunkInstance extends InstanceResource { /** * Initialize the ByocTrunkInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Voice/V1/ByocTrunkOptions.php 0000644 00000045475 15107452360 0012126 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1; use Twilio\Options; use Twilio\Values; abstract class ByocTrunkOptions { /** * @param string $friendlyName A string to describe the resource * @param string $voiceUrl The URL we should call when receiving a call * @param string $voiceMethod The HTTP method to use with voice_url * @param string $voiceFallbackUrl The URL we should call when an error occurs * in executing TwiML * @param string $voiceFallbackMethod The HTTP method to use with * voice_fallback_url * @param string $statusCallbackUrl The URL that we should call to pass status * updates * @param string $statusCallbackMethod The HTTP method we should use to call * `status_callback_url` * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup is * enabled for the trunk * @param string $connectionPolicySid Origination Connection Policy (to your * Carrier) * @param string $fromDomainSid The SID of the SIP Domain that should be used * in the `From` header of originating calls * @return CreateByocTrunkOptions Options builder */ public static function create(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::NONE, string $connectionPolicySid = Values::NONE, string $fromDomainSid = Values::NONE): CreateByocTrunkOptions { return new CreateByocTrunkOptions($friendlyName, $voiceUrl, $voiceMethod, $voiceFallbackUrl, $voiceFallbackMethod, $statusCallbackUrl, $statusCallbackMethod, $cnamLookupEnabled, $connectionPolicySid, $fromDomainSid); } /** * @param string $friendlyName A string to describe the resource * @param string $voiceUrl The URL we should call when receiving a call * @param string $voiceMethod The HTTP method we should use with voice_url * @param string $voiceFallbackUrl The URL we should call when an error occurs * in executing TwiML * @param string $voiceFallbackMethod The HTTP method used with * voice_fallback_url * @param string $statusCallbackUrl The URL that we should call to pass status * updates * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback_url * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup is * enabled for the trunk * @param string $connectionPolicySid Origination Connection Policy (to your * Carrier) * @param string $fromDomainSid The SID of the SIP Domain that should be used * in the `From` header of originating calls * @return UpdateByocTrunkOptions Options builder */ public static function update(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::NONE, string $connectionPolicySid = Values::NONE, string $fromDomainSid = Values::NONE): UpdateByocTrunkOptions { return new UpdateByocTrunkOptions($friendlyName, $voiceUrl, $voiceMethod, $voiceFallbackUrl, $voiceFallbackMethod, $statusCallbackUrl, $statusCallbackMethod, $cnamLookupEnabled, $connectionPolicySid, $fromDomainSid); } } class CreateByocTrunkOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $voiceUrl The URL we should call when receiving a call * @param string $voiceMethod The HTTP method to use with voice_url * @param string $voiceFallbackUrl The URL we should call when an error occurs * in executing TwiML * @param string $voiceFallbackMethod The HTTP method to use with * voice_fallback_url * @param string $statusCallbackUrl The URL that we should call to pass status * updates * @param string $statusCallbackMethod The HTTP method we should use to call * `status_callback_url` * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup is * enabled for the trunk * @param string $connectionPolicySid Origination Connection Policy (to your * Carrier) * @param string $fromDomainSid The SID of the SIP Domain that should be used * in the `From` header of originating calls */ 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::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 string 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 the BYOC Trunk receives a call. * * @param string $voiceUrl The URL we should call when receiving 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 to use with 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 from `voice_url`. * * @param string $voiceFallbackUrl The URL we should call when an error occurs * in executing TwiML * @return $this Fluent Builder */ public function setVoiceFallbackUrl(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 to use with * voice_fallback_url * @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 * updates * @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` * @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 * @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 Origination Connection Policy (to your * Carrier) * @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 * @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 string to describe the resource * @param string $voiceUrl The URL we should call when receiving a call * @param string $voiceMethod The HTTP method we should use with voice_url * @param string $voiceFallbackUrl The URL we should call when an error occurs * in executing TwiML * @param string $voiceFallbackMethod The HTTP method used with * voice_fallback_url * @param string $statusCallbackUrl The URL that we should call to pass status * updates * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback_url * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup is * enabled for the trunk * @param string $connectionPolicySid Origination Connection Policy (to your * Carrier) * @param string $fromDomainSid The SID of the SIP Domain that should be used * in the `From` header of originating calls */ 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::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 string 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 the BYOC Trunk receives a call. * * @param string $voiceUrl The URL we should call when receiving 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 with 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 we should call when an error occurs * in executing TwiML * @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 used with * voice_fallback_url * @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 * updates * @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 * @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 * @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 Origination Connection Policy (to your * Carrier) * @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 * @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 . ']'; } } Voice/V1/DialingPermissions/CountryInstance.php 0000644 00000010015 15107452360 0015543 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Rest\Voice\V1\DialingPermissions\Country\HighriskSpecialPrefixList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $isoCode * @property string $name * @property string $continent * @property string[] $countryCodes * @property bool $lowRiskNumbersEnabled * @property bool $highRiskSpecialNumbersEnabled * @property bool $highRiskTollfraudNumbersEnabled * @property string $url * @property array $links */ class CountryInstance extends InstanceResource { protected $_highriskSpecialPrefixes; /** * Initialize the CountryInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $isoCode The ISO country code */ public function __construct(Version $version, array $payload, string $isoCode = null) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Voice/V1/DialingPermissions/CountryPage.php 0000644 00000002547 15107452360 0014666 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class CountryPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Voice/V1/DialingPermissions/SettingsContext.php 0000644 00000004324 15107452360 0015566 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SettingsContext extends InstanceContext { /** * Initialize the SettingsContext * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Settings'; } /** * Fetch the SettingsInstance * * @return SettingsInstance Fetched SettingsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SettingsInstance { $payload = $this->version->fetch('GET', $this->uri); 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']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } Voice/V1/DialingPermissions/BulkCountryUpdateList.php 0000644 00000003221 15107452360 0016674 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class BulkCountryUpdateList extends ListResource { /** * Construct the BulkCountryUpdateList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/DialingPermissions/BulkCountryUpdates'; } /** * Create the BulkCountryUpdateInstance * * @param string $updateRequest URL encoded JSON array of update objects * @return BulkCountryUpdateInstance Created BulkCountryUpdateInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $updateRequest): BulkCountryUpdateInstance { $data = Values::of(['UpdateRequest' => $updateRequest, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new BulkCountryUpdateInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice.V1.BulkCountryUpdateList]'; } } Voice/V1/DialingPermissions/BulkCountryUpdateInstance.php 0000644 00000003675 15107452360 0017542 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property int $updateCount * @property string $updateRequest */ class BulkCountryUpdateInstance extends InstanceResource { /** * Initialize the BulkCountryUpdateInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Voice/V1/DialingPermissions/CountryContext.php 0000644 00000006640 15107452360 0015434 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Rest\Voice\V1\DialingPermissions\Country\HighriskSpecialPrefixList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property HighriskSpecialPrefixList $highriskSpecialPrefixes */ class CountryContext extends InstanceContext { protected $_highriskSpecialPrefixes; /** * Initialize the CountryContext * * @param Version $version Version that contains the resource * @param string $isoCode The ISO country code */ public function __construct(Version $version, $isoCode) { parent::__construct($version); // Path Solution $this->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 { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Voice/V1/DialingPermissions/CountryOptions.php 0000644 00000016760 15107452360 0015447 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class CountryOptions { /** * @param string $isoCode Filter to retrieve the country permissions by * specifying the ISO country code * @param string $continent Filter to retrieve the country permissions by * specifying the continent * @param string $countryCode Country code filter * @param bool $lowRiskNumbersEnabled Filter to retrieve the country * permissions with dialing to low-risk * numbers enabled * @param bool $highRiskSpecialNumbersEnabled Filter to retrieve the country * permissions with dialing to * high-risk special service numbers * enabled * @param bool $highRiskTollfraudNumbersEnabled Filter to retrieve the country * permissions with dialing to * high-risk toll fraud numbers * enabled * @return ReadCountryOptions Options builder */ public static function read(string $isoCode = Values::NONE, string $continent = Values::NONE, string $countryCode = Values::NONE, bool $lowRiskNumbersEnabled = Values::NONE, bool $highRiskSpecialNumbersEnabled = Values::NONE, bool $highRiskTollfraudNumbersEnabled = Values::NONE): ReadCountryOptions { return new ReadCountryOptions($isoCode, $continent, $countryCode, $lowRiskNumbersEnabled, $highRiskSpecialNumbersEnabled, $highRiskTollfraudNumbersEnabled); } } class ReadCountryOptions extends Options { /** * @param string $isoCode Filter to retrieve the country permissions by * specifying the ISO country code * @param string $continent Filter to retrieve the country permissions by * specifying the continent * @param string $countryCode Country code filter * @param bool $lowRiskNumbersEnabled Filter to retrieve the country * permissions with dialing to low-risk * numbers enabled * @param bool $highRiskSpecialNumbersEnabled Filter to retrieve the country * permissions with dialing to * high-risk special service numbers * enabled * @param bool $highRiskTollfraudNumbersEnabled Filter to retrieve the country * permissions with dialing to * high-risk toll fraud numbers * enabled */ public function __construct(string $isoCode = Values::NONE, string $continent = Values::NONE, string $countryCode = Values::NONE, bool $lowRiskNumbersEnabled = Values::NONE, bool $highRiskSpecialNumbersEnabled = Values::NONE, bool $highRiskTollfraudNumbersEnabled = Values::NONE) { $this->options['isoCode'] = $isoCode; $this->options['continent'] = $continent; $this->options['countryCode'] = $countryCode; $this->options['lowRiskNumbersEnabled'] = $lowRiskNumbersEnabled; $this->options['highRiskSpecialNumbersEnabled'] = $highRiskSpecialNumbersEnabled; $this->options['highRiskTollfraudNumbersEnabled'] = $highRiskTollfraudNumbersEnabled; } /** * Filter to retrieve the country permissions by specifying the [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) * * @param string $isoCode Filter to retrieve the country permissions by * specifying the ISO country code * @return $this Fluent Builder */ public function setIsoCode(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 Country code filter * @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 * @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 * @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/learn/voice-and-video/toll-fraud) numbers enabled. Can be: `true` or `false`. * * @param bool $highRiskTollfraudNumbersEnabled Filter to retrieve the country * permissions with dialing to * high-risk toll fraud numbers * enabled * @return $this Fluent Builder */ public function setHighRiskTollfraudNumbersEnabled(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 . ']'; } } Voice/V1/DialingPermissions/CountryList.php 0000644 00000013106 15107452360 0014716 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class CountryList extends ListResource { /** * Construct the CountryList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/DialingPermissions/Countries'; } /** * Streams CountryInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of CountryInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 */ 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]'; } } Voice/V1/DialingPermissions/SettingsOptions.php 0000644 00000005027 15107452360 0015576 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class SettingsOptions { /** * @param bool $dialingPermissionsInheritance `true` for the sub-account to * inherit voice dialing permissions * from the Master Project; * otherwise `false` * @return UpdateSettingsOptions Options builder */ public static function update(bool $dialingPermissionsInheritance = Values::NONE): UpdateSettingsOptions { return new UpdateSettingsOptions($dialingPermissionsInheritance); } } class UpdateSettingsOptions extends Options { /** * @param bool $dialingPermissionsInheritance `true` for the sub-account to * inherit voice dialing permissions * from the Master Project; * otherwise `false` */ public function __construct(bool $dialingPermissionsInheritance = Values::NONE) { $this->options['dialingPermissionsInheritance'] = $dialingPermissionsInheritance; } /** * `true` for the sub-account to inherit voice dialing permissions from the Master Project; otherwise `false`. * * @param bool $dialingPermissionsInheritance `true` for the sub-account to * inherit voice dialing permissions * from the Master Project; * otherwise `false` * @return $this Fluent Builder */ public function setDialingPermissionsInheritance(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 . ']'; } } Voice/V1/DialingPermissions/SettingsPage.php 0000644 00000002555 15107452360 0015022 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SettingsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Voice/V1/DialingPermissions/SettingsInstance.php 0000644 00000006232 15107452360 0015706 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property bool $dialingPermissionsInheritance * @property string $url */ class SettingsInstance extends InstanceResource { /** * Initialize the SettingsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->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) . ']'; } } Voice/V1/DialingPermissions/BulkCountryUpdatePage.php 0000644 00000002643 15107452360 0016644 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class BulkCountryUpdatePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Voice/V1/DialingPermissions/SettingsList.php 0000644 00000002135 15107452360 0015053 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SettingsList extends ListResource { /** * Construct the SettingsList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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]'; } } Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixList.php 0000644 00000011564 15107452360 0021153 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\DialingPermissions\Country; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class HighriskSpecialPrefixList extends ListResource { /** * Construct the HighriskSpecialPrefixList * * @param Version $version Version that contains the resource * @param string $isoCode The ISO country code */ public function __construct(Version $version, string $isoCode) { parent::__construct($version); // Path Solution $this->solution = ['isoCode' => $isoCode, ]; $this->uri = '/DialingPermissions/Countries/' . \rawurlencode($isoCode) . '/HighRiskSpecialPrefixes'; } /** * Streams HighriskSpecialPrefixInstance records from the API as a generator * stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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]'; } } Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixPage.php 0000644 00000002747 15107452360 0021117 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\DialingPermissions\Country; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class HighriskSpecialPrefixPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixInstance.php 0000644 00000003631 15107452360 0022000 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\DialingPermissions\Country; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $prefix */ class HighriskSpecialPrefixInstance extends InstanceResource { /** * Initialize the HighriskSpecialPrefixInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $isoCode The ISO country code */ public function __construct(Version $version, array $payload, string $isoCode) { parent::__construct($version); // Marshaled Properties $this->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]'; } } Voice/V1/IpRecordInstance.php 0000644 00000007756 15107452360 0012026 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $sid * @property string $friendlyName * @property string $ipAddress * @property int $cidrPrefixLength * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class IpRecordInstance extends InstanceResource { /** * Initialize the IpRecordInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Voice/V1/IpRecordPage.php 0000644 00000002174 15107452360 0011123 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class IpRecordPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Voice/V1/ByocTrunkPage.php 0000644 00000002202 15107452360 0011324 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ByocTrunkPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Voice/V1/ByocTrunkContext.php 0000644 00000005740 15107452360 0012106 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class ByocTrunkContext extends InstanceContext { /** * Initialize the ByocTrunkContext * * @param Version $version Version that contains the resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/ByocTrunks/' . \rawurlencode($sid) . ''; } /** * Fetch the ByocTrunkInstance * * @return ByocTrunkInstance Fetched ByocTrunkInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ByocTrunkInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ByocTrunkInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the ByocTrunkInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Voice/V1/SourceIpMappingContext.php 0000644 00000004615 15107452360 0013233 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class SourceIpMappingContext extends InstanceContext { /** * Initialize the SourceIpMappingContext * * @param Version $version Version that contains the resource * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/SourceIpMappings/' . \rawurlencode($sid) . ''; } /** * Fetch the SourceIpMappingInstance * * @return SourceIpMappingInstance Fetched SourceIpMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SourceIpMappingInstance { $payload = $this->version->fetch('GET', $this->uri); return new SourceIpMappingInstance($this->version, $payload, $this->solution['sid']); } /** * Update the SourceIpMappingInstance * * @param string $sipDomainSid The unique string that identifies a SIP Domain * @return SourceIpMappingInstance Updated SourceIpMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $sipDomainSid): SourceIpMappingInstance { $data = Values::of(['SipDomainSid' => $sipDomainSid, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SourceIpMappingInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the SourceIpMappingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Voice/V1/SourceIpMappingList.php 0000644 00000012600 15107452360 0012513 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class SourceIpMappingList extends ListResource { /** * Construct the SourceIpMappingList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/SourceIpMappings'; } /** * Create the SourceIpMappingInstance * * @param string $ipRecordSid The unique string that identifies an IP Record * @param string $sipDomainSid The unique string that identifies a SIP Domain * @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, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SourceIpMappingInstance($this->version, $payload); } /** * 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']); } /** * 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); } /** * 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 unique string that identifies the resource */ 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]'; } } Voice/V1/IpRecordOptions.php 0000644 00000010616 15107452360 0011702 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1; use Twilio\Options; use Twilio\Values; abstract class IpRecordOptions { /** * @param string $friendlyName A string to describe the resource * @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 CreateIpRecordOptions Options builder */ public static function create(string $friendlyName = Values::NONE, int $cidrPrefixLength = Values::NONE): CreateIpRecordOptions { return new CreateIpRecordOptions($friendlyName, $cidrPrefixLength); } /** * @param string $friendlyName A string to describe the resource * @return UpdateIpRecordOptions Options builder */ public static function update(string $friendlyName = Values::NONE): UpdateIpRecordOptions { return new UpdateIpRecordOptions($friendlyName); } } class CreateIpRecordOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @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. */ public function __construct(string $friendlyName = Values::NONE, int $cidrPrefixLength = Values::NONE) { $this->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 string to describe the resource * @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 string to describe the resource */ 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 string to describe the resource * @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 . ']'; } } Voice/V1/ConnectionPolicy/ConnectionPolicyTargetPage.php 0000644 00000002510 15107452360 0017313 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\ConnectionPolicy; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ConnectionPolicyTargetPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Voice/V1/ConnectionPolicy/ConnectionPolicyTargetList.php 0000644 00000014405 15107452360 0017360 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\ConnectionPolicy; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ConnectionPolicyTargetList extends ListResource { /** * Construct the ConnectionPolicyTargetList * * @param Version $version Version that contains the resource * @param string $connectionPolicySid The SID of the Connection Policy that * owns the Target */ public function __construct(Version $version, string $connectionPolicySid) { parent::__construct($version); // Path Solution $this->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 * @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']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ConnectionPolicyTargetInstance( $this->version, $payload, $this->solution['connectionPolicySid'] ); } /** * 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']); } /** * 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); } /** * 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 identifies the resource */ 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]'; } } Voice/V1/ConnectionPolicy/ConnectionPolicyTargetInstance.php 0000644 00000011575 15107452360 0020216 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\ConnectionPolicy; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $connectionPolicySid * @property string $sid * @property string $friendlyName * @property string $target * @property int $priority * @property int $weight * @property bool $enabled * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class ConnectionPolicyTargetInstance extends InstanceResource { /** * Initialize the ConnectionPolicyTargetInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $connectionPolicySid The SID of the Connection Policy that * owns the Target * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, array $payload, string $connectionPolicySid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } Voice/V1/ConnectionPolicy/ConnectionPolicyTargetOptions.php 0000644 00000017770 15107452360 0020110 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\ConnectionPolicy; use Twilio\Options; use Twilio\Values; abstract class ConnectionPolicyTargetOptions { /** * @param string $friendlyName A string to describe the resource * @param int $priority The relative importance of the target * @param int $weight The value that determines the relative load the Target * should receive compared to others with the same priority * @param bool $enabled Whether the Target is enabled * @return CreateConnectionPolicyTargetOptions Options builder */ public static function create(string $friendlyName = Values::NONE, int $priority = Values::NONE, int $weight = Values::NONE, bool $enabled = Values::NONE): CreateConnectionPolicyTargetOptions { return new CreateConnectionPolicyTargetOptions($friendlyName, $priority, $weight, $enabled); } /** * @param string $friendlyName A string to describe the resource * @param string $target The SIP address you want Twilio to route your calls to * @param int $priority The relative importance of the target * @param int $weight The value that determines the relative load the Target * should receive compared to others with the same priority * @param bool $enabled Whether the Target is enabled * @return UpdateConnectionPolicyTargetOptions Options builder */ public static function update(string $friendlyName = Values::NONE, string $target = Values::NONE, int $priority = Values::NONE, int $weight = Values::NONE, bool $enabled = Values::NONE): UpdateConnectionPolicyTargetOptions { return new UpdateConnectionPolicyTargetOptions($friendlyName, $target, $priority, $weight, $enabled); } } class CreateConnectionPolicyTargetOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param int $priority The relative importance of the target * @param int $weight The value that determines the relative load the Target * should receive compared to others with the same priority * @param bool $enabled Whether the Target is enabled */ public function __construct(string $friendlyName = Values::NONE, int $priority = Values::NONE, int $weight = Values::NONE, bool $enabled = Values::NONE) { $this->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 string to describe the resource * @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 * @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 load the Target * should receive compared to others 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 * @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 string to describe the resource * @param string $target The SIP address you want Twilio to route your calls to * @param int $priority The relative importance of the target * @param int $weight The value that determines the relative load the Target * should receive compared to others 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::NONE, int $weight = Values::NONE, bool $enabled = Values::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 string to describe the resource * @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 * @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 * @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 load the Target * should receive compared to others 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 . ']'; } } Voice/V1/ConnectionPolicy/ConnectionPolicyTargetContext.php 0000644 00000006364 15107452361 0020077 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\ConnectionPolicy; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class ConnectionPolicyTargetContext extends InstanceContext { /** * Initialize the ConnectionPolicyTargetContext * * @param Version $version Version that contains the resource * @param string $connectionPolicySid The SID of the Connection Policy that * owns the Target * @param string $sid The unique string that identifies the resource */ public function __construct(Version $version, $connectionPolicySid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['connectionPolicySid' => $connectionPolicySid, 'sid' => $sid, ]; $this->uri = '/ConnectionPolicies/' . \rawurlencode($connectionPolicySid) . '/Targets/' . \rawurlencode($sid) . ''; } /** * Fetch the ConnectionPolicyTargetInstance * * @return ConnectionPolicyTargetInstance Fetched ConnectionPolicyTargetInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ConnectionPolicyTargetInstance { $payload = $this->version->fetch('GET', $this->uri); 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']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ConnectionPolicyTargetInstance( $this->version, $payload, $this->solution['connectionPolicySid'], $this->solution['sid'] ); } /** * Delete the ConnectionPolicyTargetInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Voice/V1/ConnectionPolicyPage.php 0000644 00000002254 15107452361 0012673 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ConnectionPolicyPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Voice/V1/ArchivedCallPage.php 0000644 00000002405 15107452361 0011733 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ArchivedCallPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Voice/V1/ByocTrunkList.php 0000644 00000013422 15107452361 0011372 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ByocTrunkList extends ListResource { /** * Construct the ByocTrunkList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ByocTrunkInstance($this->version, $payload); } /** * 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']); } /** * 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); } /** * 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 unique string that identifies the resource */ 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]'; } } Voice/V1/ArchivedCallContext.php 0000644 00000003162 15107452361 0012504 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ArchivedCallContext extends InstanceContext { /** * Initialize the ArchivedCallContext * * @param Version $version Version that contains the resource * @param \DateTime $date The date of the Call in UTC. * @param string $sid The unique string that identifies this resource */ public function __construct(Version $version, $date, $sid) { parent::__construct($version); // Path Solution $this->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 { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } Voice/V1.php 0000644 00000010404 15107452361 0006613 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Voice\V1\ArchivedCallList; use Twilio\Rest\Voice\V1\ByocTrunkList; use Twilio\Rest\Voice\V1\ConnectionPolicyList; use Twilio\Rest\Voice\V1\DialingPermissionsList; use Twilio\Rest\Voice\V1\IpRecordList; use Twilio\Rest\Voice\V1\SourceIpMappingList; use Twilio\Version; /** * @property ArchivedCallList $archivedCalls * @property ByocTrunkList $byocTrunks * @property ConnectionPolicyList $connectionPolicies * @property DialingPermissionsList $dialingPermissions * @property IpRecordList $ipRecords * @property SourceIpMappingList $sourceIpMappings * @method \Twilio\Rest\Voice\V1\ArchivedCallContext archivedCalls(\DateTime $date, string $sid) * @method \Twilio\Rest\Voice\V1\ByocTrunkContext byocTrunks(string $sid) * @method \Twilio\Rest\Voice\V1\ConnectionPolicyContext connectionPolicies(string $sid) * @method \Twilio\Rest\Voice\V1\IpRecordContext ipRecords(string $sid) * @method \Twilio\Rest\Voice\V1\SourceIpMappingContext sourceIpMappings(string $sid) */ class V1 extends Version { protected $_archivedCalls; protected $_byocTrunks; protected $_connectionPolicies; protected $_dialingPermissions; protected $_ipRecords; protected $_sourceIpMappings; /** * Construct the V1 version of Voice * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->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]'; } } Routes/V2/SipDomainList.php 0000644 00000001732 15107452361 0011553 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Routes\V2; use Twilio\ListResource; use Twilio\Version; class SipDomainList extends ListResource { /** * Construct the SipDomainList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; } /** * Constructs a SipDomainContext * * @param string $sipDomain The sip_domain */ 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]'; } } Routes/V2/TrunkOptions.php 0000644 00000004370 15107452361 0011514 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Routes\V2; use Twilio\Options; use Twilio\Values; abstract class TrunkOptions { /** * @param string $voiceRegion The Inbound Processing Region used for this SIP * Trunk for voice * @param string $friendlyName A human readable description of this resource. * @return UpdateTrunkOptions Options builder */ public static function update(string $voiceRegion = Values::NONE, string $friendlyName = Values::NONE): UpdateTrunkOptions { return new UpdateTrunkOptions($voiceRegion, $friendlyName); } } class UpdateTrunkOptions extends Options { /** * @param string $voiceRegion The Inbound Processing Region used for this SIP * Trunk for voice * @param string $friendlyName A human readable description of this resource. */ public function __construct(string $voiceRegion = Values::NONE, string $friendlyName = Values::NONE) { $this->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. * @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 . ']'; } } Routes/V2/TrunkPage.php 0000644 00000002155 15107452361 0010734 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Routes\V2; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class TrunkPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Routes/V2/SipDomainPage.php 0000644 00000002205 15107452361 0011510 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Routes\V2; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SipDomainPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Routes/V2/TrunkInstance.php 0000644 00000007341 15107452361 0011626 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Routes\V2; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sipTrunkDomain * @property string $url * @property string $sid * @property string $accountSid * @property string $friendlyName * @property string $voiceRegion * @property \DateTime $dateCreated * @property \DateTime $dateUpdated */ class TrunkInstance extends InstanceResource { /** * Initialize the TrunkInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sipTrunkDomain The SIP Trunk */ public function __construct(Version $version, array $payload, string $sipTrunkDomain = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * Fetch the TrunkInstance * * @return TrunkInstance Fetched TrunkInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TrunkInstance { 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.Routes.V2.TrunkInstance ' . \implode(' ', $context) . ']'; } } Routes/V2/PhoneNumberPage.php 0000644 00000002221 15107452361 0012045 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Routes\V2; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class PhoneNumberPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } Routes/V2/PhoneNumberContext.php 0000644 00000004311 15107452361 0012617 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Routes\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class PhoneNumberContext extends InstanceContext { /** * Initialize the PhoneNumberContext * * @param Version $version Version that contains the resource * @param string $phoneNumber The phone number */ public function __construct(Version $version, $phoneNumber) { parent::__construct($version); // Path Solution $this->solution = ['phoneNumber' => $phoneNumber, ]; $this->uri = '/PhoneNumbers/' . \rawurlencode($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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new PhoneNumberInstance($this->version, $payload, $this->solution['phoneNumber']); } /** * Fetch the PhoneNumberInstance * * @return PhoneNumberInstance Fetched PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PhoneNumberInstance { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Routes/V2/SipDomainOptions.php 0000644 00000003545 15107452361 0012277 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Routes\V2; use Twilio\Options; use Twilio\Values; abstract class SipDomainOptions { /** * @param string $voiceRegion The voice_region * @param string $friendlyName The friendly_name * @return UpdateSipDomainOptions Options builder */ public static function update(string $voiceRegion = Values::NONE, string $friendlyName = Values::NONE): UpdateSipDomainOptions { return new UpdateSipDomainOptions($voiceRegion, $friendlyName); } } class UpdateSipDomainOptions extends Options { /** * @param string $voiceRegion The voice_region * @param string $friendlyName The friendly_name */ public function __construct(string $voiceRegion = Values::NONE, string $friendlyName = Values::NONE) { $this->options['voiceRegion'] = $voiceRegion; $this->options['friendlyName'] = $friendlyName; } /** * The voice_region * * @param string $voiceRegion The voice_region * @return $this Fluent Builder */ public function setVoiceRegion(string $voiceRegion): self { $this->options['voiceRegion'] = $voiceRegion; return $this; } /** * The friendly_name * * @param string $friendlyName The 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.Routes.V2.UpdateSipDomainOptions ' . $options . ']'; } } Routes/V2/SipDomainInstance.php 0000644 00000007360 15107452361 0012407 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Routes\V2; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sipDomain * @property string $url * @property string $sid * @property string $accountSid * @property string $friendlyName * @property string $voiceRegion * @property \DateTime $dateCreated * @property \DateTime $dateUpdated */ class SipDomainInstance extends InstanceResource { /** * Initialize the SipDomainInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sipDomain The sip_domain */ public function __construct(Version $version, array $payload, string $sipDomain = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * Fetch the SipDomainInstance * * @return SipDomainInstance Fetched SipDomainInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SipDomainInstance { 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.Routes.V2.SipDomainInstance ' . \implode(' ', $context) . ']'; } } Routes/V2/PhoneNumberList.php 0000644 00000001756 15107452361 0012120 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Routes\V2; use Twilio\ListResource; use Twilio\Version; class PhoneNumberList extends ListResource { /** * Construct the PhoneNumberList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; } /** * Constructs a PhoneNumberContext * * @param string $phoneNumber The phone 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.Routes.V2.PhoneNumberList]'; } } Routes/V2/TrunkContext.php 0000644 00000004207 15107452361 0011504 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Routes\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class TrunkContext extends InstanceContext { /** * Initialize the TrunkContext * * @param Version $version Version that contains the resource * @param string $sipTrunkDomain The SIP Trunk */ public function __construct(Version $version, $sipTrunkDomain) { parent::__construct($version); // Path Solution $this->solution = ['sipTrunkDomain' => $sipTrunkDomain, ]; $this->uri = '/Trunks/' . \rawurlencode($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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new TrunkInstance($this->version, $payload, $this->solution['sipTrunkDomain']); } /** * Fetch the TrunkInstance * * @return TrunkInstance Fetched TrunkInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TrunkInstance { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Routes/V2/PhoneNumberInstance.php 0000644 00000007442 15107452361 0012747 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Routes\V2; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $phoneNumber * @property string $url * @property string $sid * @property string $accountSid * @property string $friendlyName * @property string $voiceRegion * @property \DateTime $dateCreated * @property \DateTime $dateUpdated */ class PhoneNumberInstance extends InstanceResource { /** * Initialize the PhoneNumberInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $phoneNumber The phone number */ public function __construct(Version $version, array $payload, string $phoneNumber = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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.Routes.V2.PhoneNumberInstance ' . \implode(' ', $context) . ']'; } } Routes/V2/TrunkList.php 0000644 00000001720 15107452361 0010770 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Routes\V2; use Twilio\ListResource; use Twilio\Version; class TrunkList extends ListResource { /** * Construct the TrunkList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; } /** * Constructs a TrunkContext * * @param string $sipTrunkDomain 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]'; } } Routes/V2/PhoneNumberOptions.php 0000644 00000004450 15107452361 0012632 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Routes\V2; use Twilio\Options; use Twilio\Values; abstract class PhoneNumberOptions { /** * @param string $voiceRegion The Inbound Processing Region used for this phone * number for voice * @param string $friendlyName A human readable description of this resource. * @return UpdatePhoneNumberOptions Options builder */ public static function update(string $voiceRegion = Values::NONE, string $friendlyName = Values::NONE): UpdatePhoneNumberOptions { return new UpdatePhoneNumberOptions($voiceRegion, $friendlyName); } } class UpdatePhoneNumberOptions extends Options { /** * @param string $voiceRegion The Inbound Processing Region used for this phone * number for voice * @param string $friendlyName A human readable description of this resource. */ public function __construct(string $voiceRegion = Values::NONE, string $friendlyName = Values::NONE) { $this->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. * @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 . ']'; } } Routes/V2/SipDomainContext.php 0000644 00000004235 15107452361 0012265 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Routes\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class SipDomainContext extends InstanceContext { /** * Initialize the SipDomainContext * * @param Version $version Version that contains the resource * @param string $sipDomain The sip_domain */ public function __construct(Version $version, $sipDomain) { parent::__construct($version); // Path Solution $this->solution = ['sipDomain' => $sipDomain, ]; $this->uri = '/SipDomains/' . \rawurlencode($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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SipDomainInstance($this->version, $payload, $this->solution['sipDomain']); } /** * Fetch the SipDomainInstance * * @return SipDomainInstance Fetched SipDomainInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SipDomainInstance { $payload = $this->version->fetch('GET', $this->uri); 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) . ']'; } } Routes/V2.php 0000644 00000005673 15107452361 0007044 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Routes; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Routes\V2\PhoneNumberList; use Twilio\Rest\Routes\V2\SipDomainList; use Twilio\Rest\Routes\V2\TrunkList; use Twilio\Version; /** * @property PhoneNumberList $phoneNumbers * @property SipDomainList $sipDomains * @property TrunkList $trunks * @method \Twilio\Rest\Routes\V2\PhoneNumberContext phoneNumbers(string $phoneNumber) * @method \Twilio\Rest\Routes\V2\SipDomainContext sipDomains(string $sipDomain) * @method \Twilio\Rest\Routes\V2\TrunkContext trunks(string $sipTrunkDomain) */ class V2 extends Version { protected $_phoneNumbers; protected $_sipDomains; protected $_trunks; /** * Construct the V2 version of Routes * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->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]'; } } IpMessaging/V1/CredentialPage.php 0000644 00000002232 15107452361 0012623 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CredentialPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } IpMessaging/V1/CredentialOptions.php 0000644 00000016113 15107452361 0013405 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1; use Twilio\Options; use Twilio\Values; abstract class CredentialOptions { /** * @param string $friendlyName The friendly_name * @param string $certificate The certificate * @param string $privateKey The private_key * @param bool $sandbox The sandbox * @param string $apiKey The api_key * @param string $secret The secret * @return CreateCredentialOptions Options builder */ public static function create(string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::NONE, string $apiKey = Values::NONE, string $secret = Values::NONE): CreateCredentialOptions { return new CreateCredentialOptions($friendlyName, $certificate, $privateKey, $sandbox, $apiKey, $secret); } /** * @param string $friendlyName The friendly_name * @param string $certificate The certificate * @param string $privateKey The private_key * @param bool $sandbox The sandbox * @param string $apiKey The api_key * @param string $secret The secret * @return UpdateCredentialOptions Options builder */ public static function update(string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::NONE, string $apiKey = Values::NONE, string $secret = Values::NONE): UpdateCredentialOptions { return new UpdateCredentialOptions($friendlyName, $certificate, $privateKey, $sandbox, $apiKey, $secret); } } class CreateCredentialOptions extends Options { /** * @param string $friendlyName The friendly_name * @param string $certificate The certificate * @param string $privateKey The private_key * @param bool $sandbox The sandbox * @param string $apiKey The api_key * @param string $secret The secret */ public function __construct(string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::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; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The certificate * * @param string $certificate The certificate * @return $this Fluent Builder */ public function setCertificate(string $certificate): self { $this->options['certificate'] = $certificate; return $this; } /** * The private_key * * @param string $privateKey The private_key * @return $this Fluent Builder */ public function setPrivateKey(string $privateKey): self { $this->options['privateKey'] = $privateKey; return $this; } /** * The sandbox * * @param bool $sandbox The sandbox * @return $this Fluent Builder */ public function setSandbox(bool $sandbox): self { $this->options['sandbox'] = $sandbox; return $this; } /** * The api_key * * @param string $apiKey The api_key * @return $this Fluent Builder */ public function setApiKey(string $apiKey): self { $this->options['apiKey'] = $apiKey; return $this; } /** * The secret * * @param string $secret The 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 The friendly_name * @param string $certificate The certificate * @param string $privateKey The private_key * @param bool $sandbox The sandbox * @param string $apiKey The api_key * @param string $secret The secret */ public function __construct(string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::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; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The certificate * * @param string $certificate The certificate * @return $this Fluent Builder */ public function setCertificate(string $certificate): self { $this->options['certificate'] = $certificate; return $this; } /** * The private_key * * @param string $privateKey The private_key * @return $this Fluent Builder */ public function setPrivateKey(string $privateKey): self { $this->options['privateKey'] = $privateKey; return $this; } /** * The sandbox * * @param bool $sandbox The sandbox * @return $this Fluent Builder */ public function setSandbox(bool $sandbox): self { $this->options['sandbox'] = $sandbox; return $this; } /** * The api_key * * @param string $apiKey The api_key * @return $this Fluent Builder */ public function setApiKey(string $apiKey): self { $this->options['apiKey'] = $apiKey; return $this; } /** * The secret * * @param string $secret The 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 . ']'; } } IpMessaging/V1/Service/UserInstance.php 0000644 00000011653 15107452361 0013766 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\IpMessaging\V1\Service\User\UserChannelList; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $attributes * @property string $friendlyName * @property string $roleSid * @property string $identity * @property bool $isOnline * @property bool $isNotifiable * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property int $joinedChannelsCount * @property array $links * @property string $url */ class UserInstance extends InstanceResource { protected $_userChannels; /** * Initialize the UserInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The service_sid * @param string $sid The sid */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the UserInstance * * @return UserInstance Fetched UserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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) . ']'; } } IpMessaging/V1/Service/UserOptions.php 0000644 00000010467 15107452361 0013657 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Options; use Twilio\Values; abstract class UserOptions { /** * @param string $roleSid The role_sid * @param string $attributes The attributes * @param string $friendlyName The friendly_name * @return CreateUserOptions Options builder */ public static function create(string $roleSid = Values::NONE, string $attributes = Values::NONE, string $friendlyName = Values::NONE): CreateUserOptions { return new CreateUserOptions($roleSid, $attributes, $friendlyName); } /** * @param string $roleSid The role_sid * @param string $attributes The attributes * @param string $friendlyName The friendly_name * @return UpdateUserOptions Options builder */ public static function update(string $roleSid = Values::NONE, string $attributes = Values::NONE, string $friendlyName = Values::NONE): UpdateUserOptions { return new UpdateUserOptions($roleSid, $attributes, $friendlyName); } } class CreateUserOptions extends Options { /** * @param string $roleSid The role_sid * @param string $attributes The attributes * @param string $friendlyName The friendly_name */ public function __construct(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 role_sid * * @param string $roleSid The role_sid * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * The attributes * * @param string $attributes The attributes * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The friendly_name * * @param string $friendlyName The 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.IpMessaging.V1.CreateUserOptions ' . $options . ']'; } } class UpdateUserOptions extends Options { /** * @param string $roleSid The role_sid * @param string $attributes The attributes * @param string $friendlyName The friendly_name */ public function __construct(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 role_sid * * @param string $roleSid The role_sid * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * The attributes * * @param string $attributes The attributes * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The friendly_name * * @param string $friendlyName The 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.IpMessaging.V1.UpdateUserOptions ' . $options . ']'; } } IpMessaging/V1/Service/ChannelOptions.php 0000644 00000013502 15107452361 0014302 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Options; use Twilio\Values; abstract class ChannelOptions { /** * @param string $friendlyName The friendly_name * @param string $uniqueName The unique_name * @param string $attributes The attributes * @param string $type The type * @return CreateChannelOptions Options builder */ public static function create(string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, string $attributes = Values::NONE, string $type = Values::NONE): CreateChannelOptions { return new CreateChannelOptions($friendlyName, $uniqueName, $attributes, $type); } /** * @param string[] $type The type * @return ReadChannelOptions Options builder */ public static function read(array $type = Values::ARRAY_NONE): ReadChannelOptions { return new ReadChannelOptions($type); } /** * @param string $friendlyName The friendly_name * @param string $uniqueName The unique_name * @param string $attributes The attributes * @return UpdateChannelOptions Options builder */ public static function update(string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, string $attributes = Values::NONE): UpdateChannelOptions { return new UpdateChannelOptions($friendlyName, $uniqueName, $attributes); } } class CreateChannelOptions extends Options { /** * @param string $friendlyName The friendly_name * @param string $uniqueName The unique_name * @param string $attributes The attributes * @param string $type The type */ public function __construct(string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, string $attributes = Values::NONE, string $type = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['attributes'] = $attributes; $this->options['type'] = $type; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The unique_name * * @param string $uniqueName The unique_name * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The attributes * * @param string $attributes The attributes * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The type * * @param string $type The 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 The type */ public function __construct(array $type = Values::ARRAY_NONE) { $this->options['type'] = $type; } /** * The type * * @param string[] $type The 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 The friendly_name * @param string $uniqueName The unique_name * @param string $attributes The 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; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The unique_name * * @param string $uniqueName The unique_name * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The attributes * * @param string $attributes The 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 . ']'; } } IpMessaging/V1/Service/ChannelPage.php 0000644 00000002267 15107452361 0013531 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ChannelPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } IpMessaging/V1/Service/ChannelList.php 0000644 00000013574 15107452361 0013573 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ChannelList extends ListResource { /** * Construct the ChannelList * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid */ public function __construct(Version $version, string $serviceSid) { parent::__construct($version); // Path Solution $this->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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ChannelInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams ChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of ChannelInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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' => Serialize::map($options['type'], function($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ChannelPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ChannelInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return 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 */ 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]'; } } IpMessaging/V1/Service/Channel/MemberOptions.php 0000644 00000010060 15107452361 0015505 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class MemberOptions { /** * @param string $roleSid The role_sid * @return CreateMemberOptions Options builder */ public static function create(string $roleSid = Values::NONE): CreateMemberOptions { return new CreateMemberOptions($roleSid); } /** * @param string[] $identity The identity * @return ReadMemberOptions Options builder */ public static function read(array $identity = Values::ARRAY_NONE): ReadMemberOptions { return new ReadMemberOptions($identity); } /** * @param string $roleSid The role_sid * @param int $lastConsumedMessageIndex The last_consumed_message_index * @return UpdateMemberOptions Options builder */ public static function update(string $roleSid = Values::NONE, int $lastConsumedMessageIndex = Values::NONE): UpdateMemberOptions { return new UpdateMemberOptions($roleSid, $lastConsumedMessageIndex); } } class CreateMemberOptions extends Options { /** * @param string $roleSid The role_sid */ public function __construct(string $roleSid = Values::NONE) { $this->options['roleSid'] = $roleSid; } /** * The role_sid * * @param string $roleSid The role_sid * @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 The identity */ public function __construct(array $identity = Values::ARRAY_NONE) { $this->options['identity'] = $identity; } /** * The identity * * @param string[] $identity The 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 The role_sid * @param int $lastConsumedMessageIndex The last_consumed_message_index */ public function __construct(string $roleSid = Values::NONE, int $lastConsumedMessageIndex = Values::NONE) { $this->options['roleSid'] = $roleSid; $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; } /** * The role_sid * * @param string $roleSid The role_sid * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * The last_consumed_message_index * * @param int $lastConsumedMessageIndex The last_consumed_message_index * @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 . ']'; } } IpMessaging/V1/Service/Channel/MemberContext.php 0000644 00000005632 15107452361 0015507 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class MemberContext extends InstanceContext { /** * Initialize the MemberContext * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $channelSid The channel_sid * @param string $sid The sid */ public function __construct(Version $version, $serviceSid, $channelSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Members/' . \rawurlencode($sid) . ''; } /** * Fetch the MemberInstance * * @return MemberInstance Fetched MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MemberInstance { $payload = $this->version->fetch('GET', $this->uri); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Delete the MemberInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the MemberInstance * * @param array|Options $options Optional Arguments * @return MemberInstance Updated MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MemberInstance { $options = new Values($options); $data = Values::of([ 'RoleSid' => $options['roleSid'], 'LastConsumedMessageIndex' => $options['lastConsumedMessageIndex'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.MemberContext ' . \implode(' ', $context) . ']'; } } IpMessaging/V1/Service/Channel/MessageOptions.php 0000644 00000010266 15107452361 0015672 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class MessageOptions { /** * @param string $from The from * @param string $attributes The attributes * @return CreateMessageOptions Options builder */ public static function create(string $from = Values::NONE, string $attributes = Values::NONE): CreateMessageOptions { return new CreateMessageOptions($from, $attributes); } /** * @param string $order The order * @return ReadMessageOptions Options builder */ public static function read(string $order = Values::NONE): ReadMessageOptions { return new ReadMessageOptions($order); } /** * @param string $body The body * @param string $attributes The attributes * @return UpdateMessageOptions Options builder */ public static function update(string $body = Values::NONE, string $attributes = Values::NONE): UpdateMessageOptions { return new UpdateMessageOptions($body, $attributes); } } class CreateMessageOptions extends Options { /** * @param string $from The from * @param string $attributes The attributes */ public function __construct(string $from = Values::NONE, string $attributes = Values::NONE) { $this->options['from'] = $from; $this->options['attributes'] = $attributes; } /** * The from * * @param string $from The from * @return $this Fluent Builder */ public function setFrom(string $from): self { $this->options['from'] = $from; return $this; } /** * The attributes * * @param string $attributes The 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 The order */ public function __construct(string $order = Values::NONE) { $this->options['order'] = $order; } /** * The order * * @param string $order The 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 The body * @param string $attributes The attributes */ public function __construct(string $body = Values::NONE, string $attributes = Values::NONE) { $this->options['body'] = $body; $this->options['attributes'] = $attributes; } /** * The body * * @param string $body The body * @return $this Fluent Builder */ public function setBody(string $body): self { $this->options['body'] = $body; return $this; } /** * The attributes * * @param string $attributes The 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 . ']'; } } IpMessaging/V1/Service/Channel/InviteInstance.php 0000644 00000010175 15107452361 0015654 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $channelSid * @property string $serviceSid * @property string $identity * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $roleSid * @property string $createdBy * @property string $url */ class InviteInstance extends InstanceResource { /** * Initialize the InviteInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The service_sid * @param string $channelSid The channel_sid * @param string $sid The sid */ public function __construct(Version $version, array $payload, string $serviceSid, string $channelSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the InviteInstance * * @return InviteInstance Fetched InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): InviteInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } IpMessaging/V1/Service/Channel/MessagePage.php 0000644 00000002440 15107452361 0015106 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MessagePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } IpMessaging/V1/Service/Channel/MessageList.php 0000644 00000014146 15107452361 0015153 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class MessageList extends ListResource { /** * Construct the MessageList * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $channelSid The channel_sid */ public function __construct(Version $version, string $serviceSid, string $channelSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Messages'; } /** * Create the MessageInstance * * @param string $body The 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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Streams MessageInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of MessageInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 */ 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]'; } } IpMessaging/V1/Service/Channel/MemberList.php 0000644 00000014133 15107452361 0014772 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class MemberList extends ListResource { /** * Construct the MemberList * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $channelSid The channel_sid */ public function __construct(Version $version, string $serviceSid, string $channelSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Members'; } /** * Create the MemberInstance * * @param string $identity The 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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Streams MemberInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of MemberInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 */ 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]'; } } IpMessaging/V1/Service/Channel/MemberInstance.php 0000644 00000011303 15107452361 0015617 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $channelSid * @property string $serviceSid * @property string $identity * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $roleSid * @property int $lastConsumedMessageIndex * @property \DateTime $lastConsumptionTimestamp * @property string $url */ class MemberInstance extends InstanceResource { /** * Initialize the MemberInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The service_sid * @param string $channelSid The channel_sid * @param string $sid The sid */ public function __construct(Version $version, array $payload, string $serviceSid, string $channelSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the MemberInstance * * @return MemberInstance Fetched MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MemberInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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) . ']'; } } IpMessaging/V1/Service/Channel/MemberPage.php 0000644 00000002432 15107452361 0014732 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MemberPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } IpMessaging/V1/Service/Channel/MessageContext.php 0000644 00000005546 15107452361 0015670 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class MessageContext extends InstanceContext { /** * Initialize the MessageContext * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $channelSid The channel_sid * @param string $sid The sid */ public function __construct(Version $version, $serviceSid, $channelSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Messages/' . \rawurlencode($sid) . ''; } /** * Fetch the MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MessageInstance { $payload = $this->version->fetch('GET', $this->uri); return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Delete the MessageInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MessageInstance { $options = new Values($options); $data = Values::of(['Body' => $options['body'], 'Attributes' => $options['attributes'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.MessageContext ' . \implode(' ', $context) . ']'; } } IpMessaging/V1/Service/Channel/MessageInstance.php 0000644 00000011355 15107452361 0016003 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $attributes * @property string $serviceSid * @property string $to * @property string $channelSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property bool $wasEdited * @property string $from * @property string $body * @property int $index * @property string $url */ class MessageInstance extends InstanceResource { /** * Initialize the MessageInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The service_sid * @param string $channelSid The channel_sid * @param string $sid The sid */ public function __construct(Version $version, array $payload, string $serviceSid, string $channelSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MessageInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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) . ']'; } } IpMessaging/V1/Service/Channel/InviteOptions.php 0000644 00000004500 15107452361 0015536 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class InviteOptions { /** * @param string $roleSid The role_sid * @return CreateInviteOptions Options builder */ public static function create(string $roleSid = Values::NONE): CreateInviteOptions { return new CreateInviteOptions($roleSid); } /** * @param string[] $identity The identity * @return ReadInviteOptions Options builder */ public static function read(array $identity = Values::ARRAY_NONE): ReadInviteOptions { return new ReadInviteOptions($identity); } } class CreateInviteOptions extends Options { /** * @param string $roleSid The role_sid */ public function __construct(string $roleSid = Values::NONE) { $this->options['roleSid'] = $roleSid; } /** * The role_sid * * @param string $roleSid The role_sid * @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 The identity */ public function __construct(array $identity = Values::ARRAY_NONE) { $this->options['identity'] = $identity; } /** * The identity * * @param string[] $identity The 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 . ']'; } } IpMessaging/V1/Service/Channel/InviteList.php 0000644 00000014133 15107452361 0015021 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class InviteList extends ListResource { /** * Construct the InviteList * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $channelSid The channel_sid */ public function __construct(Version $version, string $serviceSid, string $channelSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Invites'; } /** * Create the InviteInstance * * @param string $identity The 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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new InviteInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Streams InviteInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of InviteInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 */ 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]'; } } IpMessaging/V1/Service/Channel/InvitePage.php 0000644 00000002432 15107452361 0014761 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class InvitePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } IpMessaging/V1/Service/Channel/InviteContext.php 0000644 00000004150 15107452361 0015530 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class InviteContext extends InstanceContext { /** * Initialize the InviteContext * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $channelSid The channel_sid * @param string $sid The sid */ public function __construct(Version $version, $serviceSid, $channelSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Invites/' . \rawurlencode($sid) . ''; } /** * Fetch the InviteInstance * * @return InviteInstance Fetched InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): InviteInstance { $payload = $this->version->fetch('GET', $this->uri); return new InviteInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Delete the InviteInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } IpMessaging/V1/Service/UserContext.php 0000644 00000010504 15107452361 0013640 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\IpMessaging\V1\Service\User\UserChannelList; use Twilio\Values; use Twilio\Version; /** * @property UserChannelList $userChannels */ class UserContext extends InstanceContext { protected $_userChannels; /** * Initialize the UserContext * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $sid The sid */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Users/' . \rawurlencode($sid) . ''; } /** * Fetch the UserInstance * * @return UserInstance Fetched UserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserInstance { $payload = $this->version->fetch('GET', $this->uri); return new UserInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Delete the UserInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserInstance { $options = new Values($options); $data = Values::of([ 'RoleSid' => $options['roleSid'], 'Attributes' => $options['attributes'], 'FriendlyName' => $options['friendlyName'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } IpMessaging/V1/Service/User/UserChannelPage.php 0000644 00000002457 15107452361 0015307 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\User; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UserChannelPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } IpMessaging/V1/Service/User/UserChannelInstance.php 0000644 00000005043 15107452361 0016171 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\User; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $serviceSid * @property string $channelSid * @property string $memberSid * @property string $status * @property int $lastConsumedMessageIndex * @property int $unreadMessagesCount * @property array $links */ class UserChannelInstance extends InstanceResource { /** * Initialize the UserChannelInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The service_sid * @param string $userSid The sid */ public function __construct(Version $version, array $payload, string $serviceSid, string $userSid) { parent::__construct($version); // Marshaled Properties $this->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]'; } } IpMessaging/V1/Service/User/UserChannelList.php 0000644 00000011124 15107452361 0015335 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\User; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class UserChannelList extends ListResource { /** * Construct the UserChannelList * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $userSid The sid */ public function __construct(Version $version, string $serviceSid, string $userSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'userSid' => $userSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Users/' . \rawurlencode($userSid) . '/Channels'; } /** * Streams UserChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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]'; } } IpMessaging/V1/Service/ChannelInstance.php 0000644 00000012562 15107452361 0014420 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\IpMessaging\V1\Service\Channel\InviteList; use Twilio\Rest\IpMessaging\V1\Service\Channel\MemberList; use Twilio\Rest\IpMessaging\V1\Service\Channel\MessageList; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $friendlyName * @property string $uniqueName * @property string $attributes * @property string $type * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $createdBy * @property int $membersCount * @property int $messagesCount * @property string $url * @property array $links */ class ChannelInstance extends InstanceResource { protected $_members; protected $_messages; protected $_invites; /** * Initialize the ChannelInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The service_sid * @param string $sid The sid */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the ChannelInstance * * @return ChannelInstance Fetched ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ChannelInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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 messages */ protected function getMessages(): MessageList { return $this->proxy()->messages; } /** * Access the invites */ protected function getInvites(): InviteList { 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.IpMessaging.V1.ChannelInstance ' . \implode(' ', $context) . ']'; } } IpMessaging/V1/Service/ChannelContext.php 0000644 00000013012 15107452361 0014267 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\IpMessaging\V1\Service\Channel\InviteList; use Twilio\Rest\IpMessaging\V1\Service\Channel\MemberList; use Twilio\Rest\IpMessaging\V1\Service\Channel\MessageList; use Twilio\Values; use Twilio\Version; /** * @property MemberList $members * @property MessageList $messages * @property InviteList $invites * @method \Twilio\Rest\IpMessaging\V1\Service\Channel\MemberContext members(string $sid) * @method \Twilio\Rest\IpMessaging\V1\Service\Channel\MessageContext messages(string $sid) * @method \Twilio\Rest\IpMessaging\V1\Service\Channel\InviteContext invites(string $sid) */ class ChannelContext extends InstanceContext { protected $_members; protected $_messages; protected $_invites; /** * Initialize the ChannelContext * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $sid The sid */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($sid) . ''; } /** * Fetch the ChannelInstance * * @return ChannelInstance Fetched ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ChannelInstance { $payload = $this->version->fetch('GET', $this->uri); return new ChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Delete the ChannelInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Updated ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ChannelInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'Attributes' => $options['attributes'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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 messages */ protected function getMessages(): MessageList { if (!$this->_messages) { $this->_messages = new MessageList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_messages; } /** * 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; } /** * 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) . ']'; } } IpMessaging/V1/Service/UserPage.php 0000644 00000002245 15107452361 0013073 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UserPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } IpMessaging/V1/Service/RolePage.php 0000644 00000002245 15107452361 0013056 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RolePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } IpMessaging/V1/Service/RoleList.php 0000644 00000012631 15107452361 0013115 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class RoleList extends ListResource { /** * Construct the RoleList * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid */ public function __construct(Version $version, string $serviceSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Roles'; } /** * Create the RoleInstance * * @param string $friendlyName The friendly_name * @param string $type The type * @param string[] $permission The 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; }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new RoleInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams RoleInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 */ 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]'; } } IpMessaging/V1/Service/UserList.php 0000644 00000012651 15107452361 0013134 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class UserList extends ListResource { /** * Construct the UserList * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid */ public function __construct(Version $version, string $serviceSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Users'; } /** * Create the UserInstance * * @param string $identity The 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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new UserInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams UserInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 */ 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]'; } } IpMessaging/V1/Service/RoleContext.php 0000644 00000005052 15107452361 0013625 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class RoleContext extends InstanceContext { /** * Initialize the RoleContext * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $sid The sid */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Roles/' . \rawurlencode($sid) . ''; } /** * Fetch the RoleInstance * * @return RoleInstance Fetched RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RoleInstance { $payload = $this->version->fetch('GET', $this->uri); return new RoleInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Delete the RoleInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the RoleInstance * * @param string[] $permission The 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; }), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new RoleInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.RoleContext ' . \implode(' ', $context) . ']'; } } IpMessaging/V1/Service/RoleInstance.php 0000644 00000010215 15107452361 0013742 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $friendlyName * @property string $type * @property string[] $permissions * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class RoleInstance extends InstanceResource { /** * Initialize the RoleInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The service_sid * @param string $sid The sid */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the RoleInstance * * @return RoleInstance Fetched RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RoleInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Update the RoleInstance * * @param string[] $permission The 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) . ']'; } } IpMessaging/V1/ServiceInstance.php 0000644 00000014171 15107452361 0013046 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\IpMessaging\V1\Service\ChannelList; use Twilio\Rest\IpMessaging\V1\Service\RoleList; use Twilio\Rest\IpMessaging\V1\Service\UserList; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $defaultServiceRoleSid * @property string $defaultChannelRoleSid * @property string $defaultChannelCreatorRoleSid * @property bool $readStatusEnabled * @property bool $reachabilityEnabled * @property int $typingIndicatorTimeout * @property int $consumptionReportInterval * @property array $limits * @property array $webhooks * @property string $preWebhookUrl * @property string $postWebhookUrl * @property string $webhookMethod * @property string[] $webhookFilters * @property array $notifications * @property string $url * @property array $links */ class ServiceInstance extends InstanceResource { protected $_channels; protected $_roles; protected $_users; /** * Initialize the ServiceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The sid */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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) . ']'; } } IpMessaging/V1/ServiceList.php 0000644 00000011773 15107452361 0012222 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ServiceList extends ListResource { /** * Construct the ServiceList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Services'; } /** * Create the ServiceInstance * * @param string $friendlyName The friendly_name * @return ServiceInstance Created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName): ServiceInstance { $data = Values::of(['FriendlyName' => $friendlyName, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ServiceInstance($this->version, $payload); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 */ 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]'; } } IpMessaging/V1/ServiceContext.php 0000644 00000022635 15107452361 0012732 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\IpMessaging\V1\Service\ChannelList; use Twilio\Rest\IpMessaging\V1\Service\RoleList; use Twilio\Rest\IpMessaging\V1\Service\UserList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property ChannelList $channels * @property RoleList $roles * @property UserList $users * @method \Twilio\Rest\IpMessaging\V1\Service\ChannelContext channels(string $sid) * @method \Twilio\Rest\IpMessaging\V1\Service\RoleContext roles(string $sid) * @method \Twilio\Rest\IpMessaging\V1\Service\UserContext users(string $sid) */ class ServiceContext extends InstanceContext { protected $_channels; protected $_roles; protected $_users; /** * Initialize the ServiceContext * * @param Version $version Version that contains the resource * @param string $sid The sid */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($sid) . ''; } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { $payload = $this->version->fetch('GET', $this->uri); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } IpMessaging/V1/CredentialContext.php 0000644 00000005214 15107452361 0013376 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class CredentialContext extends InstanceContext { /** * Initialize the CredentialContext * * @param Version $version Version that contains the resource * @param string $sid The sid */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Credentials/' . \rawurlencode($sid) . ''; } /** * Fetch the CredentialInstance * * @return CredentialInstance Fetched CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new CredentialInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the CredentialInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } IpMessaging/V1/CredentialList.php 0000644 00000013027 15107452361 0012666 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class CredentialList extends ListResource { /** * Construct the CredentialList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Credentials'; } /** * Streams CredentialInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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); } /** * Create the CredentialInstance * * @param string $type The 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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CredentialInstance($this->version, $payload); } /** * Constructs a CredentialContext * * @param string $sid The 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]'; } } IpMessaging/V1/CredentialInstance.php 0000644 00000007711 15107452361 0013522 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $friendlyName * @property string $type * @property string $sandbox * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class CredentialInstance extends InstanceResource { /** * Initialize the CredentialInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The sid */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } IpMessaging/V1/ServiceOptions.php 0000644 00000133370 15107452361 0012740 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1; use Twilio\Options; use Twilio\Values; abstract class ServiceOptions { /** * @param string $friendlyName The friendly_name * @param string $defaultServiceRoleSid The default_service_role_sid * @param string $defaultChannelRoleSid The default_channel_role_sid * @param string $defaultChannelCreatorRoleSid The * default_channel_creator_role_sid * @param bool $readStatusEnabled The read_status_enabled * @param bool $reachabilityEnabled The reachability_enabled * @param int $typingIndicatorTimeout The typing_indicator_timeout * @param int $consumptionReportInterval The consumption_report_interval * @param bool $notificationsNewMessageEnabled The * notifications.new_message.enabled * @param string $notificationsNewMessageTemplate The * notifications.new_message.template * @param bool $notificationsAddedToChannelEnabled The * notifications.added_to_channel.enabled * @param string $notificationsAddedToChannelTemplate The * notifications.added_to_channel.template * @param bool $notificationsRemovedFromChannelEnabled The * notifications.removed_from_channel.enabled * @param string $notificationsRemovedFromChannelTemplate The * notifications.removed_from_channel.template * @param bool $notificationsInvitedToChannelEnabled The * notifications.invited_to_channel.enabled * @param string $notificationsInvitedToChannelTemplate The * notifications.invited_to_channel.template * @param string $preWebhookUrl The pre_webhook_url * @param string $postWebhookUrl The post_webhook_url * @param string $webhookMethod The webhook_method * @param string[] $webhookFilters The webhook_filters * @param string $webhooksOnMessageSendUrl The webhooks.on_message_send.url * @param string $webhooksOnMessageSendMethod The * webhooks.on_message_send.method * @param string $webhooksOnMessageUpdateUrl The webhooks.on_message_update.url * @param string $webhooksOnMessageUpdateMethod The * webhooks.on_message_update.method * @param string $webhooksOnMessageRemoveUrl The webhooks.on_message_remove.url * @param string $webhooksOnMessageRemoveMethod The * webhooks.on_message_remove.method * @param string $webhooksOnChannelAddUrl The webhooks.on_channel_add.url * @param string $webhooksOnChannelAddMethod The webhooks.on_channel_add.method * @param string $webhooksOnChannelDestroyUrl The * webhooks.on_channel_destroy.url * @param string $webhooksOnChannelDestroyMethod The * webhooks.on_channel_destroy.method * @param string $webhooksOnChannelUpdateUrl The webhooks.on_channel_update.url * @param string $webhooksOnChannelUpdateMethod The * webhooks.on_channel_update.method * @param string $webhooksOnMemberAddUrl The webhooks.on_member_add.url * @param string $webhooksOnMemberAddMethod The webhooks.on_member_add.method * @param string $webhooksOnMemberRemoveUrl The webhooks.on_member_remove.url * @param string $webhooksOnMemberRemoveMethod The * webhooks.on_member_remove.method * @param string $webhooksOnMessageSentUrl The webhooks.on_message_sent.url * @param string $webhooksOnMessageSentMethod The * webhooks.on_message_sent.method * @param string $webhooksOnMessageUpdatedUrl The * webhooks.on_message_updated.url * @param string $webhooksOnMessageUpdatedMethod The * webhooks.on_message_updated.method * @param string $webhooksOnMessageRemovedUrl The * webhooks.on_message_removed.url * @param string $webhooksOnMessageRemovedMethod The * webhooks.on_message_removed.method * @param string $webhooksOnChannelAddedUrl The webhooks.on_channel_added.url * @param string $webhooksOnChannelAddedMethod The * webhooks.on_channel_added.method * @param string $webhooksOnChannelDestroyedUrl The * webhooks.on_channel_destroyed.url * @param string $webhooksOnChannelDestroyedMethod The * webhooks.on_channel_destroyed.method * @param string $webhooksOnChannelUpdatedUrl The * webhooks.on_channel_updated.url * @param string $webhooksOnChannelUpdatedMethod The * webhooks.on_channel_updated.method * @param string $webhooksOnMemberAddedUrl The webhooks.on_member_added.url * @param string $webhooksOnMemberAddedMethod The * webhooks.on_member_added.method * @param string $webhooksOnMemberRemovedUrl The webhooks.on_member_removed.url * @param string $webhooksOnMemberRemovedMethod The * webhooks.on_member_removed.method * @param int $limitsChannelMembers The limits.channel_members * @param int $limitsUserChannels The limits.user_channels * @return UpdateServiceOptions Options builder */ public static function update(string $friendlyName = Values::NONE, string $defaultServiceRoleSid = Values::NONE, string $defaultChannelRoleSid = Values::NONE, string $defaultChannelCreatorRoleSid = Values::NONE, bool $readStatusEnabled = Values::NONE, bool $reachabilityEnabled = Values::NONE, int $typingIndicatorTimeout = Values::NONE, int $consumptionReportInterval = Values::NONE, bool $notificationsNewMessageEnabled = Values::NONE, string $notificationsNewMessageTemplate = Values::NONE, bool $notificationsAddedToChannelEnabled = Values::NONE, string $notificationsAddedToChannelTemplate = Values::NONE, bool $notificationsRemovedFromChannelEnabled = Values::NONE, string $notificationsRemovedFromChannelTemplate = Values::NONE, bool $notificationsInvitedToChannelEnabled = Values::NONE, string $notificationsInvitedToChannelTemplate = Values::NONE, string $preWebhookUrl = Values::NONE, string $postWebhookUrl = Values::NONE, string $webhookMethod = Values::NONE, array $webhookFilters = Values::ARRAY_NONE, string $webhooksOnMessageSendUrl = Values::NONE, string $webhooksOnMessageSendMethod = Values::NONE, string $webhooksOnMessageUpdateUrl = Values::NONE, string $webhooksOnMessageUpdateMethod = Values::NONE, string $webhooksOnMessageRemoveUrl = Values::NONE, string $webhooksOnMessageRemoveMethod = Values::NONE, string $webhooksOnChannelAddUrl = Values::NONE, string $webhooksOnChannelAddMethod = Values::NONE, string $webhooksOnChannelDestroyUrl = Values::NONE, string $webhooksOnChannelDestroyMethod = Values::NONE, string $webhooksOnChannelUpdateUrl = Values::NONE, string $webhooksOnChannelUpdateMethod = Values::NONE, string $webhooksOnMemberAddUrl = Values::NONE, string $webhooksOnMemberAddMethod = Values::NONE, string $webhooksOnMemberRemoveUrl = Values::NONE, string $webhooksOnMemberRemoveMethod = Values::NONE, string $webhooksOnMessageSentUrl = Values::NONE, string $webhooksOnMessageSentMethod = Values::NONE, string $webhooksOnMessageUpdatedUrl = Values::NONE, string $webhooksOnMessageUpdatedMethod = Values::NONE, string $webhooksOnMessageRemovedUrl = Values::NONE, string $webhooksOnMessageRemovedMethod = Values::NONE, string $webhooksOnChannelAddedUrl = Values::NONE, string $webhooksOnChannelAddedMethod = Values::NONE, string $webhooksOnChannelDestroyedUrl = Values::NONE, string $webhooksOnChannelDestroyedMethod = Values::NONE, string $webhooksOnChannelUpdatedUrl = Values::NONE, string $webhooksOnChannelUpdatedMethod = Values::NONE, string $webhooksOnMemberAddedUrl = Values::NONE, string $webhooksOnMemberAddedMethod = Values::NONE, string $webhooksOnMemberRemovedUrl = Values::NONE, string $webhooksOnMemberRemovedMethod = Values::NONE, int $limitsChannelMembers = Values::NONE, int $limitsUserChannels = Values::NONE): UpdateServiceOptions { return new UpdateServiceOptions($friendlyName, $defaultServiceRoleSid, $defaultChannelRoleSid, $defaultChannelCreatorRoleSid, $readStatusEnabled, $reachabilityEnabled, $typingIndicatorTimeout, $consumptionReportInterval, $notificationsNewMessageEnabled, $notificationsNewMessageTemplate, $notificationsAddedToChannelEnabled, $notificationsAddedToChannelTemplate, $notificationsRemovedFromChannelEnabled, $notificationsRemovedFromChannelTemplate, $notificationsInvitedToChannelEnabled, $notificationsInvitedToChannelTemplate, $preWebhookUrl, $postWebhookUrl, $webhookMethod, $webhookFilters, $webhooksOnMessageSendUrl, $webhooksOnMessageSendMethod, $webhooksOnMessageUpdateUrl, $webhooksOnMessageUpdateMethod, $webhooksOnMessageRemoveUrl, $webhooksOnMessageRemoveMethod, $webhooksOnChannelAddUrl, $webhooksOnChannelAddMethod, $webhooksOnChannelDestroyUrl, $webhooksOnChannelDestroyMethod, $webhooksOnChannelUpdateUrl, $webhooksOnChannelUpdateMethod, $webhooksOnMemberAddUrl, $webhooksOnMemberAddMethod, $webhooksOnMemberRemoveUrl, $webhooksOnMemberRemoveMethod, $webhooksOnMessageSentUrl, $webhooksOnMessageSentMethod, $webhooksOnMessageUpdatedUrl, $webhooksOnMessageUpdatedMethod, $webhooksOnMessageRemovedUrl, $webhooksOnMessageRemovedMethod, $webhooksOnChannelAddedUrl, $webhooksOnChannelAddedMethod, $webhooksOnChannelDestroyedUrl, $webhooksOnChannelDestroyedMethod, $webhooksOnChannelUpdatedUrl, $webhooksOnChannelUpdatedMethod, $webhooksOnMemberAddedUrl, $webhooksOnMemberAddedMethod, $webhooksOnMemberRemovedUrl, $webhooksOnMemberRemovedMethod, $limitsChannelMembers, $limitsUserChannels); } } class UpdateServiceOptions extends Options { /** * @param string $friendlyName The friendly_name * @param string $defaultServiceRoleSid The default_service_role_sid * @param string $defaultChannelRoleSid The default_channel_role_sid * @param string $defaultChannelCreatorRoleSid The * default_channel_creator_role_sid * @param bool $readStatusEnabled The read_status_enabled * @param bool $reachabilityEnabled The reachability_enabled * @param int $typingIndicatorTimeout The typing_indicator_timeout * @param int $consumptionReportInterval The consumption_report_interval * @param bool $notificationsNewMessageEnabled The * notifications.new_message.enabled * @param string $notificationsNewMessageTemplate The * notifications.new_message.template * @param bool $notificationsAddedToChannelEnabled The * notifications.added_to_channel.enabled * @param string $notificationsAddedToChannelTemplate The * notifications.added_to_channel.template * @param bool $notificationsRemovedFromChannelEnabled The * notifications.removed_from_channel.enabled * @param string $notificationsRemovedFromChannelTemplate The * notifications.removed_from_channel.template * @param bool $notificationsInvitedToChannelEnabled The * notifications.invited_to_channel.enabled * @param string $notificationsInvitedToChannelTemplate The * notifications.invited_to_channel.template * @param string $preWebhookUrl The pre_webhook_url * @param string $postWebhookUrl The post_webhook_url * @param string $webhookMethod The webhook_method * @param string[] $webhookFilters The webhook_filters * @param string $webhooksOnMessageSendUrl The webhooks.on_message_send.url * @param string $webhooksOnMessageSendMethod The * webhooks.on_message_send.method * @param string $webhooksOnMessageUpdateUrl The webhooks.on_message_update.url * @param string $webhooksOnMessageUpdateMethod The * webhooks.on_message_update.method * @param string $webhooksOnMessageRemoveUrl The webhooks.on_message_remove.url * @param string $webhooksOnMessageRemoveMethod The * webhooks.on_message_remove.method * @param string $webhooksOnChannelAddUrl The webhooks.on_channel_add.url * @param string $webhooksOnChannelAddMethod The webhooks.on_channel_add.method * @param string $webhooksOnChannelDestroyUrl The * webhooks.on_channel_destroy.url * @param string $webhooksOnChannelDestroyMethod The * webhooks.on_channel_destroy.method * @param string $webhooksOnChannelUpdateUrl The webhooks.on_channel_update.url * @param string $webhooksOnChannelUpdateMethod The * webhooks.on_channel_update.method * @param string $webhooksOnMemberAddUrl The webhooks.on_member_add.url * @param string $webhooksOnMemberAddMethod The webhooks.on_member_add.method * @param string $webhooksOnMemberRemoveUrl The webhooks.on_member_remove.url * @param string $webhooksOnMemberRemoveMethod The * webhooks.on_member_remove.method * @param string $webhooksOnMessageSentUrl The webhooks.on_message_sent.url * @param string $webhooksOnMessageSentMethod The * webhooks.on_message_sent.method * @param string $webhooksOnMessageUpdatedUrl The * webhooks.on_message_updated.url * @param string $webhooksOnMessageUpdatedMethod The * webhooks.on_message_updated.method * @param string $webhooksOnMessageRemovedUrl The * webhooks.on_message_removed.url * @param string $webhooksOnMessageRemovedMethod The * webhooks.on_message_removed.method * @param string $webhooksOnChannelAddedUrl The webhooks.on_channel_added.url * @param string $webhooksOnChannelAddedMethod The * webhooks.on_channel_added.method * @param string $webhooksOnChannelDestroyedUrl The * webhooks.on_channel_destroyed.url * @param string $webhooksOnChannelDestroyedMethod The * webhooks.on_channel_destroyed.method * @param string $webhooksOnChannelUpdatedUrl The * webhooks.on_channel_updated.url * @param string $webhooksOnChannelUpdatedMethod The * webhooks.on_channel_updated.method * @param string $webhooksOnMemberAddedUrl The webhooks.on_member_added.url * @param string $webhooksOnMemberAddedMethod The * webhooks.on_member_added.method * @param string $webhooksOnMemberRemovedUrl The webhooks.on_member_removed.url * @param string $webhooksOnMemberRemovedMethod The * webhooks.on_member_removed.method * @param int $limitsChannelMembers The limits.channel_members * @param int $limitsUserChannels The limits.user_channels */ public function __construct(string $friendlyName = Values::NONE, string $defaultServiceRoleSid = Values::NONE, string $defaultChannelRoleSid = Values::NONE, string $defaultChannelCreatorRoleSid = Values::NONE, bool $readStatusEnabled = Values::NONE, bool $reachabilityEnabled = Values::NONE, int $typingIndicatorTimeout = Values::NONE, int $consumptionReportInterval = Values::NONE, bool $notificationsNewMessageEnabled = Values::NONE, string $notificationsNewMessageTemplate = Values::NONE, bool $notificationsAddedToChannelEnabled = Values::NONE, string $notificationsAddedToChannelTemplate = Values::NONE, bool $notificationsRemovedFromChannelEnabled = Values::NONE, string $notificationsRemovedFromChannelTemplate = Values::NONE, bool $notificationsInvitedToChannelEnabled = Values::NONE, string $notificationsInvitedToChannelTemplate = Values::NONE, string $preWebhookUrl = Values::NONE, string $postWebhookUrl = Values::NONE, string $webhookMethod = Values::NONE, array $webhookFilters = Values::ARRAY_NONE, string $webhooksOnMessageSendUrl = Values::NONE, string $webhooksOnMessageSendMethod = Values::NONE, string $webhooksOnMessageUpdateUrl = Values::NONE, string $webhooksOnMessageUpdateMethod = Values::NONE, string $webhooksOnMessageRemoveUrl = Values::NONE, string $webhooksOnMessageRemoveMethod = Values::NONE, string $webhooksOnChannelAddUrl = Values::NONE, string $webhooksOnChannelAddMethod = Values::NONE, string $webhooksOnChannelDestroyUrl = Values::NONE, string $webhooksOnChannelDestroyMethod = Values::NONE, string $webhooksOnChannelUpdateUrl = Values::NONE, string $webhooksOnChannelUpdateMethod = Values::NONE, string $webhooksOnMemberAddUrl = Values::NONE, string $webhooksOnMemberAddMethod = Values::NONE, string $webhooksOnMemberRemoveUrl = Values::NONE, string $webhooksOnMemberRemoveMethod = Values::NONE, string $webhooksOnMessageSentUrl = Values::NONE, string $webhooksOnMessageSentMethod = Values::NONE, string $webhooksOnMessageUpdatedUrl = Values::NONE, string $webhooksOnMessageUpdatedMethod = Values::NONE, string $webhooksOnMessageRemovedUrl = Values::NONE, string $webhooksOnMessageRemovedMethod = Values::NONE, string $webhooksOnChannelAddedUrl = Values::NONE, string $webhooksOnChannelAddedMethod = Values::NONE, string $webhooksOnChannelDestroyedUrl = Values::NONE, string $webhooksOnChannelDestroyedMethod = Values::NONE, string $webhooksOnChannelUpdatedUrl = Values::NONE, string $webhooksOnChannelUpdatedMethod = Values::NONE, string $webhooksOnMemberAddedUrl = Values::NONE, string $webhooksOnMemberAddedMethod = Values::NONE, string $webhooksOnMemberRemovedUrl = Values::NONE, string $webhooksOnMemberRemovedMethod = Values::NONE, int $limitsChannelMembers = Values::NONE, int $limitsUserChannels = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; $this->options['readStatusEnabled'] = $readStatusEnabled; $this->options['reachabilityEnabled'] = $reachabilityEnabled; $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; $this->options['consumptionReportInterval'] = $consumptionReportInterval; $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; $this->options['preWebhookUrl'] = $preWebhookUrl; $this->options['postWebhookUrl'] = $postWebhookUrl; $this->options['webhookMethod'] = $webhookMethod; $this->options['webhookFilters'] = $webhookFilters; $this->options['webhooksOnMessageSendUrl'] = $webhooksOnMessageSendUrl; $this->options['webhooksOnMessageSendMethod'] = $webhooksOnMessageSendMethod; $this->options['webhooksOnMessageUpdateUrl'] = $webhooksOnMessageUpdateUrl; $this->options['webhooksOnMessageUpdateMethod'] = $webhooksOnMessageUpdateMethod; $this->options['webhooksOnMessageRemoveUrl'] = $webhooksOnMessageRemoveUrl; $this->options['webhooksOnMessageRemoveMethod'] = $webhooksOnMessageRemoveMethod; $this->options['webhooksOnChannelAddUrl'] = $webhooksOnChannelAddUrl; $this->options['webhooksOnChannelAddMethod'] = $webhooksOnChannelAddMethod; $this->options['webhooksOnChannelDestroyUrl'] = $webhooksOnChannelDestroyUrl; $this->options['webhooksOnChannelDestroyMethod'] = $webhooksOnChannelDestroyMethod; $this->options['webhooksOnChannelUpdateUrl'] = $webhooksOnChannelUpdateUrl; $this->options['webhooksOnChannelUpdateMethod'] = $webhooksOnChannelUpdateMethod; $this->options['webhooksOnMemberAddUrl'] = $webhooksOnMemberAddUrl; $this->options['webhooksOnMemberAddMethod'] = $webhooksOnMemberAddMethod; $this->options['webhooksOnMemberRemoveUrl'] = $webhooksOnMemberRemoveUrl; $this->options['webhooksOnMemberRemoveMethod'] = $webhooksOnMemberRemoveMethod; $this->options['webhooksOnMessageSentUrl'] = $webhooksOnMessageSentUrl; $this->options['webhooksOnMessageSentMethod'] = $webhooksOnMessageSentMethod; $this->options['webhooksOnMessageUpdatedUrl'] = $webhooksOnMessageUpdatedUrl; $this->options['webhooksOnMessageUpdatedMethod'] = $webhooksOnMessageUpdatedMethod; $this->options['webhooksOnMessageRemovedUrl'] = $webhooksOnMessageRemovedUrl; $this->options['webhooksOnMessageRemovedMethod'] = $webhooksOnMessageRemovedMethod; $this->options['webhooksOnChannelAddedUrl'] = $webhooksOnChannelAddedUrl; $this->options['webhooksOnChannelAddedMethod'] = $webhooksOnChannelAddedMethod; $this->options['webhooksOnChannelDestroyedUrl'] = $webhooksOnChannelDestroyedUrl; $this->options['webhooksOnChannelDestroyedMethod'] = $webhooksOnChannelDestroyedMethod; $this->options['webhooksOnChannelUpdatedUrl'] = $webhooksOnChannelUpdatedUrl; $this->options['webhooksOnChannelUpdatedMethod'] = $webhooksOnChannelUpdatedMethod; $this->options['webhooksOnMemberAddedUrl'] = $webhooksOnMemberAddedUrl; $this->options['webhooksOnMemberAddedMethod'] = $webhooksOnMemberAddedMethod; $this->options['webhooksOnMemberRemovedUrl'] = $webhooksOnMemberRemovedUrl; $this->options['webhooksOnMemberRemovedMethod'] = $webhooksOnMemberRemovedMethod; $this->options['limitsChannelMembers'] = $limitsChannelMembers; $this->options['limitsUserChannels'] = $limitsUserChannels; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The default_service_role_sid * * @param string $defaultServiceRoleSid The default_service_role_sid * @return $this Fluent Builder */ public function setDefaultServiceRoleSid(string $defaultServiceRoleSid): self { $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; return $this; } /** * The default_channel_role_sid * * @param string $defaultChannelRoleSid The default_channel_role_sid * @return $this Fluent Builder */ public function setDefaultChannelRoleSid(string $defaultChannelRoleSid): self { $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; return $this; } /** * The default_channel_creator_role_sid * * @param string $defaultChannelCreatorRoleSid The * default_channel_creator_role_sid * @return $this Fluent Builder */ public function setDefaultChannelCreatorRoleSid(string $defaultChannelCreatorRoleSid): self { $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; return $this; } /** * The read_status_enabled * * @param bool $readStatusEnabled The read_status_enabled * @return $this Fluent Builder */ public function setReadStatusEnabled(bool $readStatusEnabled): self { $this->options['readStatusEnabled'] = $readStatusEnabled; return $this; } /** * The reachability_enabled * * @param bool $reachabilityEnabled The reachability_enabled * @return $this Fluent Builder */ public function setReachabilityEnabled(bool $reachabilityEnabled): self { $this->options['reachabilityEnabled'] = $reachabilityEnabled; return $this; } /** * The typing_indicator_timeout * * @param int $typingIndicatorTimeout The typing_indicator_timeout * @return $this Fluent Builder */ public function setTypingIndicatorTimeout(int $typingIndicatorTimeout): self { $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; return $this; } /** * The consumption_report_interval * * @param int $consumptionReportInterval The consumption_report_interval * @return $this Fluent Builder */ public function setConsumptionReportInterval(int $consumptionReportInterval): self { $this->options['consumptionReportInterval'] = $consumptionReportInterval; return $this; } /** * The notifications.new_message.enabled * * @param bool $notificationsNewMessageEnabled The * notifications.new_message.enabled * @return $this Fluent Builder */ public function setNotificationsNewMessageEnabled(bool $notificationsNewMessageEnabled): self { $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; return $this; } /** * The notifications.new_message.template * * @param string $notificationsNewMessageTemplate The * notifications.new_message.template * @return $this Fluent Builder */ public function setNotificationsNewMessageTemplate(string $notificationsNewMessageTemplate): self { $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; return $this; } /** * The notifications.added_to_channel.enabled * * @param bool $notificationsAddedToChannelEnabled The * notifications.added_to_channel.enabled * @return $this Fluent Builder */ public function setNotificationsAddedToChannelEnabled(bool $notificationsAddedToChannelEnabled): self { $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; return $this; } /** * The notifications.added_to_channel.template * * @param string $notificationsAddedToChannelTemplate The * notifications.added_to_channel.template * @return $this Fluent Builder */ public function setNotificationsAddedToChannelTemplate(string $notificationsAddedToChannelTemplate): self { $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; return $this; } /** * The notifications.removed_from_channel.enabled * * @param bool $notificationsRemovedFromChannelEnabled The * notifications.removed_from_channel.enabled * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelEnabled(bool $notificationsRemovedFromChannelEnabled): self { $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; return $this; } /** * The notifications.removed_from_channel.template * * @param string $notificationsRemovedFromChannelTemplate The * notifications.removed_from_channel.template * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelTemplate(string $notificationsRemovedFromChannelTemplate): self { $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; return $this; } /** * The notifications.invited_to_channel.enabled * * @param bool $notificationsInvitedToChannelEnabled The * notifications.invited_to_channel.enabled * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelEnabled(bool $notificationsInvitedToChannelEnabled): self { $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; return $this; } /** * The notifications.invited_to_channel.template * * @param string $notificationsInvitedToChannelTemplate The * notifications.invited_to_channel.template * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelTemplate(string $notificationsInvitedToChannelTemplate): self { $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; return $this; } /** * The pre_webhook_url * * @param string $preWebhookUrl The pre_webhook_url * @return $this Fluent Builder */ public function setPreWebhookUrl(string $preWebhookUrl): self { $this->options['preWebhookUrl'] = $preWebhookUrl; return $this; } /** * The post_webhook_url * * @param string $postWebhookUrl The post_webhook_url * @return $this Fluent Builder */ public function setPostWebhookUrl(string $postWebhookUrl): self { $this->options['postWebhookUrl'] = $postWebhookUrl; return $this; } /** * The webhook_method * * @param string $webhookMethod The webhook_method * @return $this Fluent Builder */ public function setWebhookMethod(string $webhookMethod): self { $this->options['webhookMethod'] = $webhookMethod; return $this; } /** * The webhook_filters * * @param string[] $webhookFilters The webhook_filters * @return $this Fluent Builder */ public function setWebhookFilters(array $webhookFilters): self { $this->options['webhookFilters'] = $webhookFilters; return $this; } /** * The webhooks.on_message_send.url * * @param string $webhooksOnMessageSendUrl The webhooks.on_message_send.url * @return $this Fluent Builder */ public function setWebhooksOnMessageSendUrl(string $webhooksOnMessageSendUrl): self { $this->options['webhooksOnMessageSendUrl'] = $webhooksOnMessageSendUrl; return $this; } /** * The webhooks.on_message_send.method * * @param string $webhooksOnMessageSendMethod The * webhooks.on_message_send.method * @return $this Fluent Builder */ public function setWebhooksOnMessageSendMethod(string $webhooksOnMessageSendMethod): self { $this->options['webhooksOnMessageSendMethod'] = $webhooksOnMessageSendMethod; return $this; } /** * The webhooks.on_message_update.url * * @param string $webhooksOnMessageUpdateUrl The webhooks.on_message_update.url * @return $this Fluent Builder */ public function setWebhooksOnMessageUpdateUrl(string $webhooksOnMessageUpdateUrl): self { $this->options['webhooksOnMessageUpdateUrl'] = $webhooksOnMessageUpdateUrl; return $this; } /** * The webhooks.on_message_update.method * * @param string $webhooksOnMessageUpdateMethod The * webhooks.on_message_update.method * @return $this Fluent Builder */ public function setWebhooksOnMessageUpdateMethod(string $webhooksOnMessageUpdateMethod): self { $this->options['webhooksOnMessageUpdateMethod'] = $webhooksOnMessageUpdateMethod; return $this; } /** * The webhooks.on_message_remove.url * * @param string $webhooksOnMessageRemoveUrl The webhooks.on_message_remove.url * @return $this Fluent Builder */ public function setWebhooksOnMessageRemoveUrl(string $webhooksOnMessageRemoveUrl): self { $this->options['webhooksOnMessageRemoveUrl'] = $webhooksOnMessageRemoveUrl; return $this; } /** * The webhooks.on_message_remove.method * * @param string $webhooksOnMessageRemoveMethod The * webhooks.on_message_remove.method * @return $this Fluent Builder */ public function setWebhooksOnMessageRemoveMethod(string $webhooksOnMessageRemoveMethod): self { $this->options['webhooksOnMessageRemoveMethod'] = $webhooksOnMessageRemoveMethod; return $this; } /** * The webhooks.on_channel_add.url * * @param string $webhooksOnChannelAddUrl The webhooks.on_channel_add.url * @return $this Fluent Builder */ public function setWebhooksOnChannelAddUrl(string $webhooksOnChannelAddUrl): self { $this->options['webhooksOnChannelAddUrl'] = $webhooksOnChannelAddUrl; return $this; } /** * The webhooks.on_channel_add.method * * @param string $webhooksOnChannelAddMethod The webhooks.on_channel_add.method * @return $this Fluent Builder */ public function setWebhooksOnChannelAddMethod(string $webhooksOnChannelAddMethod): self { $this->options['webhooksOnChannelAddMethod'] = $webhooksOnChannelAddMethod; return $this; } /** * The webhooks.on_channel_destroy.url * * @param string $webhooksOnChannelDestroyUrl The * webhooks.on_channel_destroy.url * @return $this Fluent Builder */ public function setWebhooksOnChannelDestroyUrl(string $webhooksOnChannelDestroyUrl): self { $this->options['webhooksOnChannelDestroyUrl'] = $webhooksOnChannelDestroyUrl; return $this; } /** * The webhooks.on_channel_destroy.method * * @param string $webhooksOnChannelDestroyMethod The * webhooks.on_channel_destroy.method * @return $this Fluent Builder */ public function setWebhooksOnChannelDestroyMethod(string $webhooksOnChannelDestroyMethod): self { $this->options['webhooksOnChannelDestroyMethod'] = $webhooksOnChannelDestroyMethod; return $this; } /** * The webhooks.on_channel_update.url * * @param string $webhooksOnChannelUpdateUrl The webhooks.on_channel_update.url * @return $this Fluent Builder */ public function setWebhooksOnChannelUpdateUrl(string $webhooksOnChannelUpdateUrl): self { $this->options['webhooksOnChannelUpdateUrl'] = $webhooksOnChannelUpdateUrl; return $this; } /** * The webhooks.on_channel_update.method * * @param string $webhooksOnChannelUpdateMethod The * webhooks.on_channel_update.method * @return $this Fluent Builder */ public function setWebhooksOnChannelUpdateMethod(string $webhooksOnChannelUpdateMethod): self { $this->options['webhooksOnChannelUpdateMethod'] = $webhooksOnChannelUpdateMethod; return $this; } /** * The webhooks.on_member_add.url * * @param string $webhooksOnMemberAddUrl The webhooks.on_member_add.url * @return $this Fluent Builder */ public function setWebhooksOnMemberAddUrl(string $webhooksOnMemberAddUrl): self { $this->options['webhooksOnMemberAddUrl'] = $webhooksOnMemberAddUrl; return $this; } /** * The webhooks.on_member_add.method * * @param string $webhooksOnMemberAddMethod The webhooks.on_member_add.method * @return $this Fluent Builder */ public function setWebhooksOnMemberAddMethod(string $webhooksOnMemberAddMethod): self { $this->options['webhooksOnMemberAddMethod'] = $webhooksOnMemberAddMethod; return $this; } /** * The webhooks.on_member_remove.url * * @param string $webhooksOnMemberRemoveUrl The webhooks.on_member_remove.url * @return $this Fluent Builder */ public function setWebhooksOnMemberRemoveUrl(string $webhooksOnMemberRemoveUrl): self { $this->options['webhooksOnMemberRemoveUrl'] = $webhooksOnMemberRemoveUrl; return $this; } /** * The webhooks.on_member_remove.method * * @param string $webhooksOnMemberRemoveMethod The * webhooks.on_member_remove.method * @return $this Fluent Builder */ public function setWebhooksOnMemberRemoveMethod(string $webhooksOnMemberRemoveMethod): self { $this->options['webhooksOnMemberRemoveMethod'] = $webhooksOnMemberRemoveMethod; return $this; } /** * The webhooks.on_message_sent.url * * @param string $webhooksOnMessageSentUrl The webhooks.on_message_sent.url * @return $this Fluent Builder */ public function setWebhooksOnMessageSentUrl(string $webhooksOnMessageSentUrl): self { $this->options['webhooksOnMessageSentUrl'] = $webhooksOnMessageSentUrl; return $this; } /** * The webhooks.on_message_sent.method * * @param string $webhooksOnMessageSentMethod The * webhooks.on_message_sent.method * @return $this Fluent Builder */ public function setWebhooksOnMessageSentMethod(string $webhooksOnMessageSentMethod): self { $this->options['webhooksOnMessageSentMethod'] = $webhooksOnMessageSentMethod; return $this; } /** * The webhooks.on_message_updated.url * * @param string $webhooksOnMessageUpdatedUrl The * webhooks.on_message_updated.url * @return $this Fluent Builder */ public function setWebhooksOnMessageUpdatedUrl(string $webhooksOnMessageUpdatedUrl): self { $this->options['webhooksOnMessageUpdatedUrl'] = $webhooksOnMessageUpdatedUrl; return $this; } /** * The webhooks.on_message_updated.method * * @param string $webhooksOnMessageUpdatedMethod The * webhooks.on_message_updated.method * @return $this Fluent Builder */ public function setWebhooksOnMessageUpdatedMethod(string $webhooksOnMessageUpdatedMethod): self { $this->options['webhooksOnMessageUpdatedMethod'] = $webhooksOnMessageUpdatedMethod; return $this; } /** * The webhooks.on_message_removed.url * * @param string $webhooksOnMessageRemovedUrl The * webhooks.on_message_removed.url * @return $this Fluent Builder */ public function setWebhooksOnMessageRemovedUrl(string $webhooksOnMessageRemovedUrl): self { $this->options['webhooksOnMessageRemovedUrl'] = $webhooksOnMessageRemovedUrl; return $this; } /** * The webhooks.on_message_removed.method * * @param string $webhooksOnMessageRemovedMethod The * webhooks.on_message_removed.method * @return $this Fluent Builder */ public function setWebhooksOnMessageRemovedMethod(string $webhooksOnMessageRemovedMethod): self { $this->options['webhooksOnMessageRemovedMethod'] = $webhooksOnMessageRemovedMethod; return $this; } /** * The webhooks.on_channel_added.url * * @param string $webhooksOnChannelAddedUrl The webhooks.on_channel_added.url * @return $this Fluent Builder */ public function setWebhooksOnChannelAddedUrl(string $webhooksOnChannelAddedUrl): self { $this->options['webhooksOnChannelAddedUrl'] = $webhooksOnChannelAddedUrl; return $this; } /** * The webhooks.on_channel_added.method * * @param string $webhooksOnChannelAddedMethod The * webhooks.on_channel_added.method * @return $this Fluent Builder */ public function setWebhooksOnChannelAddedMethod(string $webhooksOnChannelAddedMethod): self { $this->options['webhooksOnChannelAddedMethod'] = $webhooksOnChannelAddedMethod; return $this; } /** * The webhooks.on_channel_destroyed.url * * @param string $webhooksOnChannelDestroyedUrl The * webhooks.on_channel_destroyed.url * @return $this Fluent Builder */ public function setWebhooksOnChannelDestroyedUrl(string $webhooksOnChannelDestroyedUrl): self { $this->options['webhooksOnChannelDestroyedUrl'] = $webhooksOnChannelDestroyedUrl; return $this; } /** * The webhooks.on_channel_destroyed.method * * @param string $webhooksOnChannelDestroyedMethod The * webhooks.on_channel_destroyed.method * @return $this Fluent Builder */ public function setWebhooksOnChannelDestroyedMethod(string $webhooksOnChannelDestroyedMethod): self { $this->options['webhooksOnChannelDestroyedMethod'] = $webhooksOnChannelDestroyedMethod; return $this; } /** * The webhooks.on_channel_updated.url * * @param string $webhooksOnChannelUpdatedUrl The * webhooks.on_channel_updated.url * @return $this Fluent Builder */ public function setWebhooksOnChannelUpdatedUrl(string $webhooksOnChannelUpdatedUrl): self { $this->options['webhooksOnChannelUpdatedUrl'] = $webhooksOnChannelUpdatedUrl; return $this; } /** * The webhooks.on_channel_updated.method * * @param string $webhooksOnChannelUpdatedMethod The * webhooks.on_channel_updated.method * @return $this Fluent Builder */ public function setWebhooksOnChannelUpdatedMethod(string $webhooksOnChannelUpdatedMethod): self { $this->options['webhooksOnChannelUpdatedMethod'] = $webhooksOnChannelUpdatedMethod; return $this; } /** * The webhooks.on_member_added.url * * @param string $webhooksOnMemberAddedUrl The webhooks.on_member_added.url * @return $this Fluent Builder */ public function setWebhooksOnMemberAddedUrl(string $webhooksOnMemberAddedUrl): self { $this->options['webhooksOnMemberAddedUrl'] = $webhooksOnMemberAddedUrl; return $this; } /** * The webhooks.on_member_added.method * * @param string $webhooksOnMemberAddedMethod The * webhooks.on_member_added.method * @return $this Fluent Builder */ public function setWebhooksOnMemberAddedMethod(string $webhooksOnMemberAddedMethod): self { $this->options['webhooksOnMemberAddedMethod'] = $webhooksOnMemberAddedMethod; return $this; } /** * The webhooks.on_member_removed.url * * @param string $webhooksOnMemberRemovedUrl The webhooks.on_member_removed.url * @return $this Fluent Builder */ public function setWebhooksOnMemberRemovedUrl(string $webhooksOnMemberRemovedUrl): self { $this->options['webhooksOnMemberRemovedUrl'] = $webhooksOnMemberRemovedUrl; return $this; } /** * The webhooks.on_member_removed.method * * @param string $webhooksOnMemberRemovedMethod The * webhooks.on_member_removed.method * @return $this Fluent Builder */ public function setWebhooksOnMemberRemovedMethod(string $webhooksOnMemberRemovedMethod): self { $this->options['webhooksOnMemberRemovedMethod'] = $webhooksOnMemberRemovedMethod; return $this; } /** * The limits.channel_members * * @param int $limitsChannelMembers The limits.channel_members * @return $this Fluent Builder */ public function setLimitsChannelMembers(int $limitsChannelMembers): self { $this->options['limitsChannelMembers'] = $limitsChannelMembers; return $this; } /** * The limits.user_channels * * @param int $limitsUserChannels The limits.user_channels * @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 . ']'; } } IpMessaging/V1/ServicePage.php 0000644 00000002210 15107452361 0012145 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ServicePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } IpMessaging/V1.php 0000644 00000005120 15107452361 0007753 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\IpMessaging\V1\CredentialList; use Twilio\Rest\IpMessaging\V1\ServiceList; use Twilio\Version; /** * @property CredentialList $credentials * @property ServiceList $services * @method \Twilio\Rest\IpMessaging\V1\CredentialContext credentials(string $sid) * @method \Twilio\Rest\IpMessaging\V1\ServiceContext services(string $sid) */ class V1 extends Version { protected $_credentials; protected $_services; /** * Construct the V1 version of IpMessaging * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->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]'; } } IpMessaging/V2/CredentialPage.php 0000644 00000002232 15107452361 0012624 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CredentialPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } IpMessaging/V2/CredentialOptions.php 0000644 00000016113 15107452361 0013406 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2; use Twilio\Options; use Twilio\Values; abstract class CredentialOptions { /** * @param string $friendlyName The friendly_name * @param string $certificate The certificate * @param string $privateKey The private_key * @param bool $sandbox The sandbox * @param string $apiKey The api_key * @param string $secret The secret * @return CreateCredentialOptions Options builder */ public static function create(string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::NONE, string $apiKey = Values::NONE, string $secret = Values::NONE): CreateCredentialOptions { return new CreateCredentialOptions($friendlyName, $certificate, $privateKey, $sandbox, $apiKey, $secret); } /** * @param string $friendlyName The friendly_name * @param string $certificate The certificate * @param string $privateKey The private_key * @param bool $sandbox The sandbox * @param string $apiKey The api_key * @param string $secret The secret * @return UpdateCredentialOptions Options builder */ public static function update(string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::NONE, string $apiKey = Values::NONE, string $secret = Values::NONE): UpdateCredentialOptions { return new UpdateCredentialOptions($friendlyName, $certificate, $privateKey, $sandbox, $apiKey, $secret); } } class CreateCredentialOptions extends Options { /** * @param string $friendlyName The friendly_name * @param string $certificate The certificate * @param string $privateKey The private_key * @param bool $sandbox The sandbox * @param string $apiKey The api_key * @param string $secret The secret */ public function __construct(string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::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; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The certificate * * @param string $certificate The certificate * @return $this Fluent Builder */ public function setCertificate(string $certificate): self { $this->options['certificate'] = $certificate; return $this; } /** * The private_key * * @param string $privateKey The private_key * @return $this Fluent Builder */ public function setPrivateKey(string $privateKey): self { $this->options['privateKey'] = $privateKey; return $this; } /** * The sandbox * * @param bool $sandbox The sandbox * @return $this Fluent Builder */ public function setSandbox(bool $sandbox): self { $this->options['sandbox'] = $sandbox; return $this; } /** * The api_key * * @param string $apiKey The api_key * @return $this Fluent Builder */ public function setApiKey(string $apiKey): self { $this->options['apiKey'] = $apiKey; return $this; } /** * The secret * * @param string $secret The 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 The friendly_name * @param string $certificate The certificate * @param string $privateKey The private_key * @param bool $sandbox The sandbox * @param string $apiKey The api_key * @param string $secret The secret */ public function __construct(string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::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; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The certificate * * @param string $certificate The certificate * @return $this Fluent Builder */ public function setCertificate(string $certificate): self { $this->options['certificate'] = $certificate; return $this; } /** * The private_key * * @param string $privateKey The private_key * @return $this Fluent Builder */ public function setPrivateKey(string $privateKey): self { $this->options['privateKey'] = $privateKey; return $this; } /** * The sandbox * * @param bool $sandbox The sandbox * @return $this Fluent Builder */ public function setSandbox(bool $sandbox): self { $this->options['sandbox'] = $sandbox; return $this; } /** * The api_key * * @param string $apiKey The api_key * @return $this Fluent Builder */ public function setApiKey(string $apiKey): self { $this->options['apiKey'] = $apiKey; return $this; } /** * The secret * * @param string $secret The 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 . ']'; } } IpMessaging/V2/Service/BindingContext.php 0000644 00000003670 15107452361 0014303 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class BindingContext extends InstanceContext { /** * Initialize the BindingContext * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $sid The sid */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Bindings/' . \rawurlencode($sid) . ''; } /** * Fetch the BindingInstance * * @return BindingInstance Fetched BindingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): BindingInstance { $payload = $this->version->fetch('GET', $this->uri); return new BindingInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Delete the BindingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } IpMessaging/V2/Service/UserInstance.php 0000644 00000012245 15107452361 0013765 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\IpMessaging\V2\Service\User\UserBindingList; use Twilio\Rest\IpMessaging\V2\Service\User\UserChannelList; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $attributes * @property string $friendlyName * @property string $roleSid * @property string $identity * @property bool $isOnline * @property bool $isNotifiable * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property int $joinedChannelsCount * @property array $links * @property string $url */ class UserInstance extends InstanceResource { protected $_userChannels; protected $_userBindings; /** * Initialize the UserInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The service_sid * @param string $sid The sid */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the UserInstance * * @return UserInstance Fetched UserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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; } /** * Access the userBindings */ protected function getUserBindings(): UserBindingList { return $this->proxy()->userBindings; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } IpMessaging/V2/Service/BindingOptions.php 0000644 00000003471 15107452361 0014311 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Options; use Twilio\Values; abstract class BindingOptions { /** * @param string[] $bindingType The binding_type * @param string[] $identity The identity * @return ReadBindingOptions Options builder */ public static function read(array $bindingType = Values::ARRAY_NONE, array $identity = Values::ARRAY_NONE): ReadBindingOptions { return new ReadBindingOptions($bindingType, $identity); } } class ReadBindingOptions extends Options { /** * @param string[] $bindingType The binding_type * @param string[] $identity The identity */ public function __construct(array $bindingType = Values::ARRAY_NONE, array $identity = Values::ARRAY_NONE) { $this->options['bindingType'] = $bindingType; $this->options['identity'] = $identity; } /** * The binding_type * * @param string[] $bindingType The binding_type * @return $this Fluent Builder */ public function setBindingType(array $bindingType): self { $this->options['bindingType'] = $bindingType; return $this; } /** * The identity * * @param string[] $identity The 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 . ']'; } } IpMessaging/V2/Service/UserOptions.php 0000644 00000014105 15107452361 0013651 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Options; use Twilio\Values; abstract class UserOptions { /** * @param string $roleSid The role_sid * @param string $attributes The attributes * @param string $friendlyName The friendly_name * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return CreateUserOptions Options builder */ public static function create(string $roleSid = Values::NONE, string $attributes = Values::NONE, string $friendlyName = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE): CreateUserOptions { return new CreateUserOptions($roleSid, $attributes, $friendlyName, $xTwilioWebhookEnabled); } /** * @param string $roleSid The role_sid * @param string $attributes The attributes * @param string $friendlyName The friendly_name * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return UpdateUserOptions Options builder */ public static function update(string $roleSid = Values::NONE, string $attributes = Values::NONE, string $friendlyName = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE): UpdateUserOptions { return new UpdateUserOptions($roleSid, $attributes, $friendlyName, $xTwilioWebhookEnabled); } } class CreateUserOptions extends Options { /** * @param string $roleSid The role_sid * @param string $attributes The attributes * @param string $friendlyName The friendly_name * @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 role_sid * * @param string $roleSid The role_sid * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * The attributes * * @param string $attributes The attributes * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @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 The role_sid * @param string $attributes The attributes * @param string $friendlyName The friendly_name * @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 role_sid * * @param string $roleSid The role_sid * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * The attributes * * @param string $attributes The attributes * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @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 . ']'; } } IpMessaging/V2/Service/ChannelOptions.php 0000644 00000030172 15107452361 0014305 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Options; use Twilio\Values; abstract class ChannelOptions { /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return DeleteChannelOptions Options builder */ public static function delete(string $xTwilioWebhookEnabled = Values::NONE): DeleteChannelOptions { return new DeleteChannelOptions($xTwilioWebhookEnabled); } /** * @param string $friendlyName The friendly_name * @param string $uniqueName The unique_name * @param string $attributes The attributes * @param string $type The type * @param \DateTime $dateCreated The date_created * @param \DateTime $dateUpdated The date_updated * @param string $createdBy The created_by * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return CreateChannelOptions Options builder */ public static function create(string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, string $attributes = Values::NONE, string $type = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, string $createdBy = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE): CreateChannelOptions { return new CreateChannelOptions($friendlyName, $uniqueName, $attributes, $type, $dateCreated, $dateUpdated, $createdBy, $xTwilioWebhookEnabled); } /** * @param string[] $type The type * @return ReadChannelOptions Options builder */ public static function read(array $type = Values::ARRAY_NONE): ReadChannelOptions { return new ReadChannelOptions($type); } /** * @param string $friendlyName The friendly_name * @param string $uniqueName The unique_name * @param string $attributes The attributes * @param \DateTime $dateCreated The date_created * @param \DateTime $dateUpdated The date_updated * @param string $createdBy The created_by * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return UpdateChannelOptions Options builder */ public static function update(string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, string $attributes = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, string $createdBy = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE): UpdateChannelOptions { return new UpdateChannelOptions($friendlyName, $uniqueName, $attributes, $dateCreated, $dateUpdated, $createdBy, $xTwilioWebhookEnabled); } } 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 CreateChannelOptions extends Options { /** * @param string $friendlyName The friendly_name * @param string $uniqueName The unique_name * @param string $attributes The attributes * @param string $type The type * @param \DateTime $dateCreated The date_created * @param \DateTime $dateUpdated The date_updated * @param string $createdBy The created_by * @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, string $type = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, string $createdBy = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['attributes'] = $attributes; $this->options['type'] = $type; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['createdBy'] = $createdBy; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The unique_name * * @param string $uniqueName The unique_name * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The attributes * * @param string $attributes The attributes * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The type * * @param string $type The type * @return $this Fluent Builder */ public function setType(string $type): self { $this->options['type'] = $type; return $this; } /** * The date_created * * @param \DateTime $dateCreated The date_created * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date_updated * * @param \DateTime $dateUpdated The date_updated * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The created_by * * @param string $createdBy The created_by * @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 ReadChannelOptions extends Options { /** * @param string[] $type The type */ public function __construct(array $type = Values::ARRAY_NONE) { $this->options['type'] = $type; } /** * The type * * @param string[] $type The 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 The friendly_name * @param string $uniqueName The unique_name * @param string $attributes The attributes * @param \DateTime $dateCreated The date_created * @param \DateTime $dateUpdated The date_updated * @param string $createdBy The created_by * @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 = Values::NONE, \DateTime $dateUpdated = Values::NONE, 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; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The unique_name * * @param string $uniqueName The unique_name * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The attributes * * @param string $attributes The attributes * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The date_created * * @param \DateTime $dateCreated The date_created * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date_updated * * @param \DateTime $dateUpdated The date_updated * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The created_by * * @param string $createdBy The created_by * @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 . ']'; } } IpMessaging/V2/Service/ChannelPage.php 0000644 00000002267 15107452361 0013532 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ChannelPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } IpMessaging/V2/Service/ChannelList.php 0000644 00000014300 15107452361 0013560 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ChannelList extends ListResource { /** * Construct the ChannelList * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid */ public function __construct(Version $version, string $serviceSid) { parent::__construct($version); // Path Solution $this->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(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled'], ]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new ChannelInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams ChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of ChannelInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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' => Serialize::map($options['type'], function($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ChannelPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ChannelInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return 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 */ 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]'; } } IpMessaging/V2/Service/Channel/WebhookPage.php 0000644 00000002440 15107452361 0015121 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class WebhookPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } IpMessaging/V2/Service/Channel/MemberOptions.php 0000644 00000031056 15107452361 0015516 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class MemberOptions { /** * @param string $roleSid The role_sid * @param int $lastConsumedMessageIndex The last_consumed_message_index * @param \DateTime $lastConsumptionTimestamp The last_consumption_timestamp * @param \DateTime $dateCreated The date_created * @param \DateTime $dateUpdated The date_updated * @param string $attributes The attributes * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return CreateMemberOptions Options builder */ public static function create(string $roleSid = Values::NONE, int $lastConsumedMessageIndex = Values::NONE, \DateTime $lastConsumptionTimestamp = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, string $attributes = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE): CreateMemberOptions { return new CreateMemberOptions($roleSid, $lastConsumedMessageIndex, $lastConsumptionTimestamp, $dateCreated, $dateUpdated, $attributes, $xTwilioWebhookEnabled); } /** * @param string[] $identity The identity * @return ReadMemberOptions Options builder */ public static function read(array $identity = Values::ARRAY_NONE): ReadMemberOptions { return new ReadMemberOptions($identity); } /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return DeleteMemberOptions Options builder */ public static function delete(string $xTwilioWebhookEnabled = Values::NONE): DeleteMemberOptions { return new DeleteMemberOptions($xTwilioWebhookEnabled); } /** * @param string $roleSid The role_sid * @param int $lastConsumedMessageIndex The last_consumed_message_index * @param \DateTime $lastConsumptionTimestamp The last_consumption_timestamp * @param \DateTime $dateCreated The date_created * @param \DateTime $dateUpdated The date_updated * @param string $attributes The attributes * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return UpdateMemberOptions Options builder */ public static function update(string $roleSid = Values::NONE, int $lastConsumedMessageIndex = Values::NONE, \DateTime $lastConsumptionTimestamp = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, string $attributes = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE): UpdateMemberOptions { return new UpdateMemberOptions($roleSid, $lastConsumedMessageIndex, $lastConsumptionTimestamp, $dateCreated, $dateUpdated, $attributes, $xTwilioWebhookEnabled); } } class CreateMemberOptions extends Options { /** * @param string $roleSid The role_sid * @param int $lastConsumedMessageIndex The last_consumed_message_index * @param \DateTime $lastConsumptionTimestamp The last_consumption_timestamp * @param \DateTime $dateCreated The date_created * @param \DateTime $dateUpdated The date_updated * @param string $attributes The attributes * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header */ public function __construct(string $roleSid = Values::NONE, int $lastConsumedMessageIndex = Values::NONE, \DateTime $lastConsumptionTimestamp = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, 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 role_sid * * @param string $roleSid The role_sid * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * The last_consumed_message_index * * @param int $lastConsumedMessageIndex The last_consumed_message_index * @return $this Fluent Builder */ public function setLastConsumedMessageIndex(int $lastConsumedMessageIndex): self { $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; return $this; } /** * The last_consumption_timestamp * * @param \DateTime $lastConsumptionTimestamp The last_consumption_timestamp * @return $this Fluent Builder */ public function setLastConsumptionTimestamp(\DateTime $lastConsumptionTimestamp): self { $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; return $this; } /** * The date_created * * @param \DateTime $dateCreated The date_created * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date_updated * * @param \DateTime $dateUpdated The date_updated * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The attributes * * @param string $attributes The 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 ReadMemberOptions extends Options { /** * @param string[] $identity The identity */ public function __construct(array $identity = Values::ARRAY_NONE) { $this->options['identity'] = $identity; } /** * The identity * * @param string[] $identity The 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 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 UpdateMemberOptions extends Options { /** * @param string $roleSid The role_sid * @param int $lastConsumedMessageIndex The last_consumed_message_index * @param \DateTime $lastConsumptionTimestamp The last_consumption_timestamp * @param \DateTime $dateCreated The date_created * @param \DateTime $dateUpdated The date_updated * @param string $attributes The attributes * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header */ public function __construct(string $roleSid = Values::NONE, int $lastConsumedMessageIndex = Values::NONE, \DateTime $lastConsumptionTimestamp = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, 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 role_sid * * @param string $roleSid The role_sid * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * The last_consumed_message_index * * @param int $lastConsumedMessageIndex The last_consumed_message_index * @return $this Fluent Builder */ public function setLastConsumedMessageIndex(int $lastConsumedMessageIndex): self { $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; return $this; } /** * The last_consumption_timestamp * * @param \DateTime $lastConsumptionTimestamp The last_consumption_timestamp * @return $this Fluent Builder */ public function setLastConsumptionTimestamp(\DateTime $lastConsumptionTimestamp): self { $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; return $this; } /** * The date_created * * @param \DateTime $dateCreated The date_created * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date_updated * * @param \DateTime $dateUpdated The date_updated * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The attributes * * @param string $attributes The 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 . ']'; } } IpMessaging/V2/Service/Channel/MemberContext.php 0000644 00000007116 15107452361 0015507 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class MemberContext extends InstanceContext { /** * Initialize the MemberContext * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $channelSid The channel_sid * @param string $sid The sid */ public function __construct(Version $version, $serviceSid, $channelSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Members/' . \rawurlencode($sid) . ''; } /** * Fetch the MemberInstance * * @return MemberInstance Fetched MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MemberInstance { $payload = $this->version->fetch('GET', $this->uri); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['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(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled'], ]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * 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(['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) . ']'; } } IpMessaging/V2/Service/Channel/WebhookList.php 0000644 00000014262 15107452361 0015165 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class WebhookList extends ListResource { /** * Construct the WebhookList * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $channelSid The channel_sid */ public function __construct(Version $version, string $serviceSid, string $channelSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Webhooks'; } /** * Streams WebhookInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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); } /** * Create the WebhookInstance * * @param string $type The 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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new WebhookInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Constructs a WebhookContext * * @param string $sid The 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]'; } } IpMessaging/V2/Service/Channel/MessageOptions.php 0000644 00000027577 15107452361 0015710 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class MessageOptions { /** * @param string $from The from * @param string $attributes The attributes * @param \DateTime $dateCreated The date_created * @param \DateTime $dateUpdated The date_updated * @param string $lastUpdatedBy The last_updated_by * @param string $body The body * @param string $mediaSid The media_sid * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return CreateMessageOptions Options builder */ public static function create(string $from = Values::NONE, string $attributes = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, string $lastUpdatedBy = Values::NONE, string $body = Values::NONE, string $mediaSid = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE): CreateMessageOptions { return new CreateMessageOptions($from, $attributes, $dateCreated, $dateUpdated, $lastUpdatedBy, $body, $mediaSid, $xTwilioWebhookEnabled); } /** * @param string $order The order * @return ReadMessageOptions Options builder */ public static function read(string $order = Values::NONE): ReadMessageOptions { return new ReadMessageOptions($order); } /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return DeleteMessageOptions Options builder */ public static function delete(string $xTwilioWebhookEnabled = Values::NONE): DeleteMessageOptions { return new DeleteMessageOptions($xTwilioWebhookEnabled); } /** * @param string $body The body * @param string $attributes The attributes * @param \DateTime $dateCreated The date_created * @param \DateTime $dateUpdated The date_updated * @param string $lastUpdatedBy The last_updated_by * @param string $from The from * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header * @return UpdateMessageOptions Options builder */ public static function update(string $body = Values::NONE, string $attributes = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, string $lastUpdatedBy = Values::NONE, string $from = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE): UpdateMessageOptions { return new UpdateMessageOptions($body, $attributes, $dateCreated, $dateUpdated, $lastUpdatedBy, $from, $xTwilioWebhookEnabled); } } class CreateMessageOptions extends Options { /** * @param string $from The from * @param string $attributes The attributes * @param \DateTime $dateCreated The date_created * @param \DateTime $dateUpdated The date_updated * @param string $lastUpdatedBy The last_updated_by * @param string $body The body * @param string $mediaSid The media_sid * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP * request header */ public function __construct(string $from = Values::NONE, string $attributes = Values::NONE, \DateTime $dateCreated = Values::NONE, \DateTime $dateUpdated = Values::NONE, string $lastUpdatedBy = Values::NONE, string $body = Values::NONE, string $mediaSid = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE) { $this->options['from'] = $from; $this->options['attributes'] = $attributes; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['lastUpdatedBy'] = $lastUpdatedBy; $this->options['body'] = $body; $this->options['mediaSid'] = $mediaSid; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The from * * @param string $from The from * @return $this Fluent Builder */ public function setFrom(string $from): self { $this->options['from'] = $from; return $this; } /** * The attributes * * @param string $attributes The attributes * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The date_created * * @param \DateTime $dateCreated The date_created * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date_updated * * @param \DateTime $dateUpdated The date_updated * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The last_updated_by * * @param string $lastUpdatedBy The last_updated_by * @return $this Fluent Builder */ public function setLastUpdatedBy(string $lastUpdatedBy): self { $this->options['lastUpdatedBy'] = $lastUpdatedBy; return $this; } /** * The body * * @param string $body The body * @return $this Fluent Builder */ public function setBody(string $body): self { $this->options['body'] = $body; return $this; } /** * The media_sid * * @param string $mediaSid The media_sid * @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 ReadMessageOptions extends Options { /** * @param string $order The order */ public function __construct(string $order = Values::NONE) { $this->options['order'] = $order; } /** * The order * * @param string $order The 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 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 UpdateMessageOptions extends Options { /** * @param string $body The body * @param string $attributes The attributes * @param \DateTime $dateCreated The date_created * @param \DateTime $dateUpdated The date_updated * @param string $lastUpdatedBy The last_updated_by * @param string $from The 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 = Values::NONE, \DateTime $dateUpdated = Values::NONE, 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 body * * @param string $body The body * @return $this Fluent Builder */ public function setBody(string $body): self { $this->options['body'] = $body; return $this; } /** * The attributes * * @param string $attributes The attributes * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The date_created * * @param \DateTime $dateCreated The date_created * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date_updated * * @param \DateTime $dateUpdated The date_updated * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The last_updated_by * * @param string $lastUpdatedBy The last_updated_by * @return $this Fluent Builder */ public function setLastUpdatedBy(string $lastUpdatedBy): self { $this->options['lastUpdatedBy'] = $lastUpdatedBy; return $this; } /** * The from * * @param string $from The 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 . ']'; } } IpMessaging/V2/Service/Channel/InviteInstance.php 0000644 00000010175 15107452361 0015655 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $channelSid * @property string $serviceSid * @property string $identity * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $roleSid * @property string $createdBy * @property string $url */ class InviteInstance extends InstanceResource { /** * Initialize the InviteInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The service_sid * @param string $channelSid The channel_sid * @param string $sid The sid */ public function __construct(Version $version, array $payload, string $serviceSid, string $channelSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the InviteInstance * * @return InviteInstance Fetched InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): InviteInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } IpMessaging/V2/Service/Channel/MessagePage.php 0000644 00000002440 15107452361 0015107 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MessagePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } IpMessaging/V2/Service/Channel/MessageList.php 0000644 00000014721 15107452361 0015153 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class MessageList extends ListResource { /** * Construct the MessageList * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $channelSid The channel_sid */ public function __construct(Version $version, string $serviceSid, string $channelSid) { parent::__construct($version); // Path Solution $this->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(['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'] ); } /** * 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']); } /** * 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); } /** * Retrieve a single page of MessageInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 */ 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]'; } } IpMessaging/V2/Service/Channel/MemberList.php 0000644 00000015176 15107452361 0015003 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class MemberList extends ListResource { /** * Construct the MemberList * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $channelSid The channel_sid */ public function __construct(Version $version, string $serviceSid, string $channelSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Members'; } /** * Create the MemberInstance * * @param string $identity The 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(['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'] ); } /** * 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']); } /** * 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); } /** * Retrieve a single page of MemberInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 */ 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]'; } } IpMessaging/V2/Service/Channel/MemberInstance.php 0000644 00000011575 15107452361 0015633 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $channelSid * @property string $serviceSid * @property string $identity * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $roleSid * @property int $lastConsumedMessageIndex * @property \DateTime $lastConsumptionTimestamp * @property string $url * @property string $attributes */ class MemberInstance extends InstanceResource { /** * Initialize the MemberInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The service_sid * @param string $channelSid The channel_sid * @param string $sid The sid */ public function __construct(Version $version, array $payload, string $serviceSid, string $channelSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the MemberInstance * * @return MemberInstance Fetched MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MemberInstance { return $this->proxy()->fetch(); } /** * 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); } /** * 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) . ']'; } } IpMessaging/V2/Service/Channel/MemberPage.php 0000644 00000002432 15107452361 0014733 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MemberPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } IpMessaging/V2/Service/Channel/WebhookContext.php 0000644 00000006517 15107452361 0015702 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class WebhookContext extends InstanceContext { /** * Initialize the WebhookContext * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $channelSid The channel_sid * @param string $sid The sid */ public function __construct(Version $version, $serviceSid, $channelSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Webhooks/' . \rawurlencode($sid) . ''; } /** * Fetch the WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WebhookInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new WebhookInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Delete the WebhookInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } IpMessaging/V2/Service/Channel/MessageContext.php 0000644 00000006775 15107452361 0015676 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class MessageContext extends InstanceContext { /** * Initialize the MessageContext * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $channelSid The channel_sid * @param string $sid The sid */ public function __construct(Version $version, $serviceSid, $channelSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Messages/' . \rawurlencode($sid) . ''; } /** * Fetch the MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MessageInstance { $payload = $this->version->fetch('GET', $this->uri); return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['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(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled'], ]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * 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(['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) . ']'; } } IpMessaging/V2/Service/Channel/MessageInstance.php 0000644 00000012136 15107452361 0016002 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $attributes * @property string $serviceSid * @property string $to * @property string $channelSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $lastUpdatedBy * @property bool $wasEdited * @property string $from * @property string $body * @property int $index * @property string $type * @property array $media * @property string $url */ class MessageInstance extends InstanceResource { /** * Initialize the MessageInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The service_sid * @param string $channelSid The channel_sid * @param string $sid The sid */ public function __construct(Version $version, array $payload, string $serviceSid, string $channelSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MessageInstance { return $this->proxy()->fetch(); } /** * 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); } /** * 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) . ']'; } } IpMessaging/V2/Service/Channel/InviteOptions.php 0000644 00000004500 15107452361 0015537 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class InviteOptions { /** * @param string $roleSid The role_sid * @return CreateInviteOptions Options builder */ public static function create(string $roleSid = Values::NONE): CreateInviteOptions { return new CreateInviteOptions($roleSid); } /** * @param string[] $identity The identity * @return ReadInviteOptions Options builder */ public static function read(array $identity = Values::ARRAY_NONE): ReadInviteOptions { return new ReadInviteOptions($identity); } } class CreateInviteOptions extends Options { /** * @param string $roleSid The role_sid */ public function __construct(string $roleSid = Values::NONE) { $this->options['roleSid'] = $roleSid; } /** * The role_sid * * @param string $roleSid The role_sid * @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 The identity */ public function __construct(array $identity = Values::ARRAY_NONE) { $this->options['identity'] = $identity; } /** * The identity * * @param string[] $identity The 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 . ']'; } } IpMessaging/V2/Service/Channel/InviteList.php 0000644 00000014133 15107452361 0015022 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class InviteList extends ListResource { /** * Construct the InviteList * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $channelSid The channel_sid */ public function __construct(Version $version, string $serviceSid, string $channelSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Invites'; } /** * Create the InviteInstance * * @param string $identity The 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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new InviteInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Streams InviteInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of InviteInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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 */ 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]'; } } IpMessaging/V2/Service/Channel/InvitePage.php 0000644 00000002432 15107452361 0014762 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class InvitePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } IpMessaging/V2/Service/Channel/InviteContext.php 0000644 00000004150 15107452361 0015531 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class InviteContext extends InstanceContext { /** * Initialize the InviteContext * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $channelSid The channel_sid * @param string $sid The sid */ public function __construct(Version $version, $serviceSid, $channelSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Invites/' . \rawurlencode($sid) . ''; } /** * Fetch the InviteInstance * * @return InviteInstance Fetched InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): InviteInstance { $payload = $this->version->fetch('GET', $this->uri); return new InviteInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Delete the InviteInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } IpMessaging/V2/Service/Channel/WebhookInstance.php 0000644 00000010631 15107452361 0016012 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $channelSid * @property string $type * @property string $url * @property array $configuration * @property \DateTime $dateCreated * @property \DateTime $dateUpdated */ class WebhookInstance extends InstanceResource { /** * Initialize the WebhookInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The service_sid * @param string $channelSid The channel_sid * @param string $sid The sid */ public function __construct(Version $version, array $payload, string $serviceSid, string $channelSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } IpMessaging/V2/Service/Channel/WebhookOptions.php 0000644 00000022362 15107452361 0015705 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class WebhookOptions { /** * @param string $configurationUrl The configuration.url * @param string $configurationMethod The configuration.method * @param string[] $configurationFilters The configuration.filters * @param string[] $configurationTriggers The configuration.triggers * @param string $configurationFlowSid The configuration.flow_sid * @param int $configurationRetryCount The configuration.retry_count * @return CreateWebhookOptions Options builder */ public static function create(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::NONE): CreateWebhookOptions { return new CreateWebhookOptions($configurationUrl, $configurationMethod, $configurationFilters, $configurationTriggers, $configurationFlowSid, $configurationRetryCount); } /** * @param string $configurationUrl The configuration.url * @param string $configurationMethod The configuration.method * @param string[] $configurationFilters The configuration.filters * @param string[] $configurationTriggers The configuration.triggers * @param string $configurationFlowSid The configuration.flow_sid * @param int $configurationRetryCount The configuration.retry_count * @return UpdateWebhookOptions Options builder */ public static function update(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::NONE): UpdateWebhookOptions { return new UpdateWebhookOptions($configurationUrl, $configurationMethod, $configurationFilters, $configurationTriggers, $configurationFlowSid, $configurationRetryCount); } } class CreateWebhookOptions extends Options { /** * @param string $configurationUrl The configuration.url * @param string $configurationMethod The configuration.method * @param string[] $configurationFilters The configuration.filters * @param string[] $configurationTriggers The configuration.triggers * @param string $configurationFlowSid The configuration.flow_sid * @param int $configurationRetryCount The configuration.retry_count */ 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::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 configuration.url * * @param string $configurationUrl The configuration.url * @return $this Fluent Builder */ public function setConfigurationUrl(string $configurationUrl): self { $this->options['configurationUrl'] = $configurationUrl; return $this; } /** * The configuration.method * * @param string $configurationMethod The configuration.method * @return $this Fluent Builder */ public function setConfigurationMethod(string $configurationMethod): self { $this->options['configurationMethod'] = $configurationMethod; return $this; } /** * The configuration.filters * * @param string[] $configurationFilters The configuration.filters * @return $this Fluent Builder */ public function setConfigurationFilters(array $configurationFilters): self { $this->options['configurationFilters'] = $configurationFilters; return $this; } /** * The configuration.triggers * * @param string[] $configurationTriggers The configuration.triggers * @return $this Fluent Builder */ public function setConfigurationTriggers(array $configurationTriggers): self { $this->options['configurationTriggers'] = $configurationTriggers; return $this; } /** * The configuration.flow_sid * * @param string $configurationFlowSid The configuration.flow_sid * @return $this Fluent Builder */ public function setConfigurationFlowSid(string $configurationFlowSid): self { $this->options['configurationFlowSid'] = $configurationFlowSid; return $this; } /** * The configuration.retry_count * * @param int $configurationRetryCount The configuration.retry_count * @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 The configuration.url * @param string $configurationMethod The configuration.method * @param string[] $configurationFilters The configuration.filters * @param string[] $configurationTriggers The configuration.triggers * @param string $configurationFlowSid The configuration.flow_sid * @param int $configurationRetryCount The configuration.retry_count */ 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::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 configuration.url * * @param string $configurationUrl The configuration.url * @return $this Fluent Builder */ public function setConfigurationUrl(string $configurationUrl): self { $this->options['configurationUrl'] = $configurationUrl; return $this; } /** * The configuration.method * * @param string $configurationMethod The configuration.method * @return $this Fluent Builder */ public function setConfigurationMethod(string $configurationMethod): self { $this->options['configurationMethod'] = $configurationMethod; return $this; } /** * The configuration.filters * * @param string[] $configurationFilters The configuration.filters * @return $this Fluent Builder */ public function setConfigurationFilters(array $configurationFilters): self { $this->options['configurationFilters'] = $configurationFilters; return $this; } /** * The configuration.triggers * * @param string[] $configurationTriggers The configuration.triggers * @return $this Fluent Builder */ public function setConfigurationTriggers(array $configurationTriggers): self { $this->options['configurationTriggers'] = $configurationTriggers; return $this; } /** * The configuration.flow_sid * * @param string $configurationFlowSid The configuration.flow_sid * @return $this Fluent Builder */ public function setConfigurationFlowSid(string $configurationFlowSid): self { $this->options['configurationFlowSid'] = $configurationFlowSid; return $this; } /** * The configuration.retry_count * * @param int $configurationRetryCount The configuration.retry_count * @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 . ']'; } } IpMessaging/V2/Service/UserContext.php 0000644 00000012205 15107452361 0013641 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\IpMessaging\V2\Service\User\UserBindingList; use Twilio\Rest\IpMessaging\V2\Service\User\UserChannelList; use Twilio\Values; use Twilio\Version; /** * @property UserChannelList $userChannels * @property UserBindingList $userBindings * @method \Twilio\Rest\IpMessaging\V2\Service\User\UserChannelContext userChannels(string $channelSid) * @method \Twilio\Rest\IpMessaging\V2\Service\User\UserBindingContext userBindings(string $sid) */ class UserContext extends InstanceContext { protected $_userChannels; protected $_userBindings; /** * Initialize the UserContext * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $sid The sid */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Users/' . \rawurlencode($sid) . ''; } /** * Fetch the UserInstance * * @return UserInstance Fetched UserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserInstance { $payload = $this->version->fetch('GET', $this->uri); return new UserInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Delete the UserInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserInstance { $options = new Values($options); $data = Values::of([ 'RoleSid' => $options['roleSid'], 'Attributes' => $options['attributes'], 'FriendlyName' => $options['friendlyName'], ]); $headers = Values::of(['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 userChannels */ protected function getUserChannels(): UserChannelList { if (!$this->_userChannels) { $this->_userChannels = new UserChannelList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_userChannels; } /** * 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; } /** * 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) . ']'; } } IpMessaging/V2/Service/BindingPage.php 0000644 00000002267 15107452361 0013534 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class BindingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } IpMessaging/V2/Service/User/UserChannelPage.php 0000644 00000002457 15107452361 0015310 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\User; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UserChannelPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } IpMessaging/V2/Service/User/UserBindingPage.php 0000644 00000002457 15107452361 0015312 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\User; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UserBindingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } IpMessaging/V2/Service/User/UserBindingInstance.php 0000644 00000010604 15107452361 0016173 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\User; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $endpoint * @property string $identity * @property string $userSid * @property string $credentialSid * @property string $bindingType * @property string[] $messageTypes * @property string $url */ class UserBindingInstance extends InstanceResource { /** * Initialize the UserBindingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The service_sid * @param string $userSid The user_sid * @param string $sid The sid */ public function __construct(Version $version, array $payload, string $serviceSid, string $userSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the UserBindingInstance * * @return UserBindingInstance Fetched UserBindingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserBindingInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } IpMessaging/V2/Service/User/UserChannelContext.php 0000644 00000006222 15107452361 0016052 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\User; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class UserChannelContext extends InstanceContext { /** * Initialize the UserChannelContext * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $userSid The user_sid * @param string $channelSid The channel_sid */ public function __construct(Version $version, $serviceSid, $userSid, $channelSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'userSid' => $userSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Users/' . \rawurlencode($userSid) . '/Channels/' . \rawurlencode($channelSid) . ''; } /** * Fetch the UserChannelInstance * * @return UserChannelInstance Fetched UserChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserChannelInstance { $payload = $this->version->fetch('GET', $this->uri); return new UserChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid'], $this->solution['channelSid'] ); } /** * Delete the UserChannelInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the UserChannelInstance * * @param array|Options $options Optional Arguments * @return UserChannelInstance Updated UserChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserChannelInstance { $options = new Values($options); $data = Values::of([ 'NotificationLevel' => $options['notificationLevel'], 'LastConsumedMessageIndex' => $options['lastConsumedMessageIndex'], 'LastConsumptionTimestamp' => Serialize::iso8601DateTime($options['lastConsumptionTimestamp']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new UserChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid'], $this->solution['channelSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.UserChannelContext ' . \implode(' ', $context) . ']'; } } IpMessaging/V2/Service/User/UserChannelInstance.php 0000644 00000011303 15107452361 0016166 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\User; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $serviceSid * @property string $channelSid * @property string $userSid * @property string $memberSid * @property string $status * @property int $lastConsumedMessageIndex * @property int $unreadMessagesCount * @property array $links * @property string $url * @property string $notificationLevel */ class UserChannelInstance extends InstanceResource { /** * Initialize the UserChannelInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The service_sid * @param string $userSid The user_sid * @param string $channelSid The channel_sid */ public function __construct(Version $version, array $payload, string $serviceSid, string $userSid, string $channelSid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the UserChannelInstance * * @return UserChannelInstance Fetched UserChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserChannelInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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) . ']'; } } IpMessaging/V2/Service/User/UserChannelList.php 0000644 00000011721 15107452361 0015341 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\User; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class UserChannelList extends ListResource { /** * Construct the UserChannelList * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $userSid The user_sid */ public function __construct(Version $version, string $serviceSid, string $userSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'userSid' => $userSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Users/' . \rawurlencode($userSid) . '/Channels'; } /** * Streams UserChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 channel_sid */ 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]'; } } IpMessaging/V2/Service/User/UserBindingOptions.php 0000644 00000002560 15107452361 0016064 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\User; use Twilio\Options; use Twilio\Values; abstract class UserBindingOptions { /** * @param string[] $bindingType The binding_type * @return ReadUserBindingOptions Options builder */ public static function read(array $bindingType = Values::ARRAY_NONE): ReadUserBindingOptions { return new ReadUserBindingOptions($bindingType); } } class ReadUserBindingOptions extends Options { /** * @param string[] $bindingType The binding_type */ public function __construct(array $bindingType = Values::ARRAY_NONE) { $this->options['bindingType'] = $bindingType; } /** * The binding_type * * @param string[] $bindingType The binding_type * @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 . ']'; } } IpMessaging/V2/Service/User/UserBindingContext.php 0000644 00000004173 15107452361 0016057 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\User; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class UserBindingContext extends InstanceContext { /** * Initialize the UserBindingContext * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $userSid The user_sid * @param string $sid The sid */ public function __construct(Version $version, $serviceSid, $userSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'userSid' => $userSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Users/' . \rawurlencode($userSid) . '/Bindings/' . \rawurlencode($sid) . ''; } /** * Fetch the UserBindingInstance * * @return UserBindingInstance Fetched UserBindingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserBindingInstance { $payload = $this->version->fetch('GET', $this->uri); return new UserBindingInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid'], $this->solution['sid'] ); } /** * Delete the UserBindingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } IpMessaging/V2/Service/User/UserBindingList.php 0000644 00000012623 15107452361 0015345 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\User; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class UserBindingList extends ListResource { /** * Construct the UserBindingList * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $userSid The user_sid */ public function __construct(Version $version, string $serviceSid, string $userSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'userSid' => $userSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Users/' . \rawurlencode($userSid) . '/Bindings'; } /** * Streams UserBindingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of UserBindingInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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' => Serialize::map($options['bindingType'], function($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new UserBindingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserBindingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return 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 */ 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]'; } } IpMessaging/V2/Service/User/UserChannelOptions.php 0000644 00000005617 15107452361 0016070 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\User; use Twilio\Options; use Twilio\Values; abstract class UserChannelOptions { /** * @param string $notificationLevel The notification_level * @param int $lastConsumedMessageIndex The last_consumed_message_index * @param \DateTime $lastConsumptionTimestamp The last_consumption_timestamp * @return UpdateUserChannelOptions Options builder */ public static function update(string $notificationLevel = Values::NONE, int $lastConsumedMessageIndex = Values::NONE, \DateTime $lastConsumptionTimestamp = Values::NONE): UpdateUserChannelOptions { return new UpdateUserChannelOptions($notificationLevel, $lastConsumedMessageIndex, $lastConsumptionTimestamp); } } class UpdateUserChannelOptions extends Options { /** * @param string $notificationLevel The notification_level * @param int $lastConsumedMessageIndex The last_consumed_message_index * @param \DateTime $lastConsumptionTimestamp The last_consumption_timestamp */ public function __construct(string $notificationLevel = Values::NONE, int $lastConsumedMessageIndex = Values::NONE, \DateTime $lastConsumptionTimestamp = Values::NONE) { $this->options['notificationLevel'] = $notificationLevel; $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; } /** * The notification_level * * @param string $notificationLevel The notification_level * @return $this Fluent Builder */ public function setNotificationLevel(string $notificationLevel): self { $this->options['notificationLevel'] = $notificationLevel; return $this; } /** * The last_consumed_message_index * * @param int $lastConsumedMessageIndex The last_consumed_message_index * @return $this Fluent Builder */ public function setLastConsumedMessageIndex(int $lastConsumedMessageIndex): self { $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; return $this; } /** * The last_consumption_timestamp * * @param \DateTime $lastConsumptionTimestamp The last_consumption_timestamp * @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 . ']'; } } IpMessaging/V2/Service/ChannelInstance.php 0000644 00000013252 15107452361 0014416 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\IpMessaging\V2\Service\Channel\InviteList; use Twilio\Rest\IpMessaging\V2\Service\Channel\MemberList; use Twilio\Rest\IpMessaging\V2\Service\Channel\MessageList; use Twilio\Rest\IpMessaging\V2\Service\Channel\WebhookList; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $friendlyName * @property string $uniqueName * @property string $attributes * @property string $type * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $createdBy * @property int $membersCount * @property int $messagesCount * @property string $url * @property array $links */ class ChannelInstance extends InstanceResource { protected $_members; protected $_messages; protected $_invites; protected $_webhooks; /** * Initialize the ChannelInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The service_sid * @param string $sid The sid */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the ChannelInstance * * @return ChannelInstance Fetched ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ChannelInstance { return $this->proxy()->fetch(); } /** * 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); } /** * 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 messages */ protected function getMessages(): MessageList { return $this->proxy()->messages; } /** * Access the invites */ protected function getInvites(): InviteList { return $this->proxy()->invites; } /** * Access the webhooks */ protected function getWebhooks(): WebhookList { return $this->proxy()->webhooks; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } IpMessaging/V2/Service/ChannelContext.php 0000644 00000015215 15107452361 0014277 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\IpMessaging\V2\Service\Channel\InviteList; use Twilio\Rest\IpMessaging\V2\Service\Channel\MemberList; use Twilio\Rest\IpMessaging\V2\Service\Channel\MessageList; use Twilio\Rest\IpMessaging\V2\Service\Channel\WebhookList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property MemberList $members * @property MessageList $messages * @property InviteList $invites * @property WebhookList $webhooks * @method \Twilio\Rest\IpMessaging\V2\Service\Channel\MemberContext members(string $sid) * @method \Twilio\Rest\IpMessaging\V2\Service\Channel\MessageContext messages(string $sid) * @method \Twilio\Rest\IpMessaging\V2\Service\Channel\InviteContext invites(string $sid) * @method \Twilio\Rest\IpMessaging\V2\Service\Channel\WebhookContext webhooks(string $sid) */ class ChannelContext extends InstanceContext { protected $_members; protected $_messages; protected $_invites; protected $_webhooks; /** * Initialize the ChannelContext * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $sid The sid */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($sid) . ''; } /** * Fetch the ChannelInstance * * @return ChannelInstance Fetched ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ChannelInstance { $payload = $this->version->fetch('GET', $this->uri); return new ChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['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(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled'], ]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * 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(['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 messages */ protected function getMessages(): MessageList { if (!$this->_messages) { $this->_messages = new MessageList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_messages; } /** * 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; } /** * 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) . ']'; } } IpMessaging/V2/Service/UserPage.php 0000644 00000002245 15107452361 0013074 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UserPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } IpMessaging/V2/Service/RolePage.php 0000644 00000002245 15107452361 0013057 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RolePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->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]'; } } IpMessaging/V2/Service/RoleList.php 0000644 00000012631 15107452361 0013116 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class RoleList extends ListResource { /** * Construct the RoleList * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid */ public function __construct(Version $version, string $serviceSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Roles'; } /** * Create the RoleInstance * * @param string $friendlyName The friendly_name * @param string $type The type * @param string[] $permission The 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; }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new RoleInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams RoleInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 */ 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]'; } } IpMessaging/V2/Service/BindingInstance.php 0000644 00000010233 15107452361 0014414 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $endpoint * @property string $identity * @property string $credentialSid * @property string $bindingType * @property string[] $messageTypes * @property string $url * @property array $links */ class BindingInstance extends InstanceResource { /** * Initialize the BindingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The service_sid * @param string $sid The sid */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the BindingInstance * * @return BindingInstance Fetched BindingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): BindingInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } IpMessaging/V2/Service/BindingList.php 0000644 00000012320 15107452361 0013562 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class BindingList extends ListResource { /** * Construct the BindingList * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid */ public function __construct(Version $version, string $serviceSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Bindings'; } /** * Streams BindingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * Retrieve a single page of BindingInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return 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' => Serialize::map($options['bindingType'], function($e) { return $e; }), 'Identity' => Serialize::map($options['identity'], function($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new BindingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of BindingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return 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 */ 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]'; } } IpMessaging/V2/Service/UserList.php 0000644 00000013027 15107452361 0013133 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class UserList extends ListResource { /** * Construct the UserList * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid */ public function __construct(Version $version, string $serviceSid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Users'; } /** * Create the UserInstance * * @param string $identity The 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(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled'], ]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new UserInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams UserInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 */ 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]'; } } IpMessaging/V2/Service/RoleContext.php 0000644 00000005052 15107452361 0013626 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class RoleContext extends InstanceContext { /** * Initialize the RoleContext * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $sid The sid */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Roles/' . \rawurlencode($sid) . ''; } /** * Fetch the RoleInstance * * @return RoleInstance Fetched RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RoleInstance { $payload = $this->version->fetch('GET', $this->uri); return new RoleInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Delete the RoleInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the RoleInstance * * @param string[] $permission The 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; }), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new RoleInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.RoleContext ' . \implode(' ', $context) . ']'; } } IpMessaging/V2/Service/RoleInstance.php 0000644 00000010215 15107452361 0013743 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $friendlyName * @property string $type * @property string[] $permissions * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class RoleInstance extends InstanceResource { /** * Initialize the RoleInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The service_sid * @param string $sid The sid */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the RoleInstance * * @return RoleInstance Fetched RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RoleInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * Update the RoleInstance * * @param string[] $permission The 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) . ']'; } } IpMessaging/V2/ServiceInstance.php 0000644 00000015132 15107452361 0013045 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Rest\IpMessaging\V2\Service\BindingList; use Twilio\Rest\IpMessaging\V2\Service\ChannelList; use Twilio\Rest\IpMessaging\V2\Service\RoleList; use Twilio\Rest\IpMessaging\V2\Service\UserList; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $defaultServiceRoleSid * @property string $defaultChannelRoleSid * @property string $defaultChannelCreatorRoleSid * @property bool $readStatusEnabled * @property bool $reachabilityEnabled * @property int $typingIndicatorTimeout * @property int $consumptionReportInterval * @property array $limits * @property string $preWebhookUrl * @property string $postWebhookUrl * @property string $webhookMethod * @property string[] $webhookFilters * @property int $preWebhookRetryCount * @property int $postWebhookRetryCount * @property array $notifications * @property array $media * @property string $url * @property array $links */ class ServiceInstance extends InstanceResource { protected $_channels; protected $_roles; protected $_users; protected $_bindings; /** * Initialize the ServiceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The sid */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { return $this->proxy()->fetch(); } /** * 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(); } /** * 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; } /** * 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.IpMessaging.V2.ServiceInstance ' . \implode(' ', $context) . ']'; } } IpMessaging/V2/ServiceList.php 0000644 00000011773 15107452361 0012223 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ServiceList extends ListResource { /** * Construct the ServiceList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Services'; } /** * Create the ServiceInstance * * @param string $friendlyName The friendly_name * @return ServiceInstance Created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName): ServiceInstance { $data = Values::of(['FriendlyName' => $friendlyName, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ServiceInstance($this->version, $payload); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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 */ 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]'; } } IpMessaging/V2/ServiceContext.php 0000644 00000017727 15107452361 0012741 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\IpMessaging\V2\Service\BindingList; use Twilio\Rest\IpMessaging\V2\Service\ChannelList; use Twilio\Rest\IpMessaging\V2\Service\RoleList; use Twilio\Rest\IpMessaging\V2\Service\UserList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property ChannelList $channels * @property RoleList $roles * @property UserList $users * @property BindingList $bindings * @method \Twilio\Rest\IpMessaging\V2\Service\ChannelContext channels(string $sid) * @method \Twilio\Rest\IpMessaging\V2\Service\RoleContext roles(string $sid) * @method \Twilio\Rest\IpMessaging\V2\Service\UserContext users(string $sid) * @method \Twilio\Rest\IpMessaging\V2\Service\BindingContext bindings(string $sid) */ class ServiceContext extends InstanceContext { protected $_channels; protected $_roles; protected $_users; protected $_bindings; /** * Initialize the ServiceContext * * @param Version $version Version that contains the resource * @param string $sid The sid */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($sid) . ''; } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { $payload = $this->version->fetch('GET', $this->uri); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(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']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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; } /** * 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.IpMessaging.V2.ServiceContext ' . \implode(' ', $context) . ']'; } } IpMessaging/V2/CredentialContext.php 0000644 00000005214 15107452361 0013377 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class CredentialContext extends InstanceContext { /** * Initialize the CredentialContext * * @param Version $version Version that contains the resource * @param string $sid The sid */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = ['sid' => $sid, ]; $this->uri = '/Credentials/' . \rawurlencode($sid) . ''; } /** * Fetch the CredentialInstance * * @return CredentialInstance Fetched CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialInstance { $payload = $this->version->fetch('GET', $this->uri); 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'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new CredentialInstance($this->version, $payload, $this->solution['sid']); } /** * Delete the CredentialInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide 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) . ']'; } } IpMessaging/V2/CredentialList.php 0000644 00000013027 15107452361 0012667 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class CredentialList extends ListResource { /** * Construct the CredentialList * * @param Version $version Version that contains the resource */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = []; $this->uri = '/Credentials'; } /** * Streams CredentialInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return 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']); } /** * 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); } /** * 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); } /** * Create the CredentialInstance * * @param string $type The 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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CredentialInstance($this->version, $payload); } /** * Constructs a CredentialContext * * @param string $sid The 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]'; } } IpMessaging/V2/CredentialInstance.php 0000644 00000007711 15107452361 0013523 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $friendlyName * @property string $type * @property string $sandbox * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class CredentialInstance extends InstanceResource { /** * Initialize the CredentialInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The sid */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->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; } /** * 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); } /** * 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(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } IpMessaging/V2/ServiceOptions.php 0000644 00000064153 15107452361 0012743 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2; use Twilio\Options; use Twilio\Values; abstract class ServiceOptions { /** * @param string $friendlyName The friendly_name * @param string $defaultServiceRoleSid The default_service_role_sid * @param string $defaultChannelRoleSid The default_channel_role_sid * @param string $defaultChannelCreatorRoleSid The * default_channel_creator_role_sid * @param bool $readStatusEnabled The read_status_enabled * @param bool $reachabilityEnabled The reachability_enabled * @param int $typingIndicatorTimeout The typing_indicator_timeout * @param int $consumptionReportInterval The consumption_report_interval * @param bool $notificationsNewMessageEnabled The * notifications.new_message.enabled * @param string $notificationsNewMessageTemplate The * notifications.new_message.template * @param string $notificationsNewMessageSound The * notifications.new_message.sound * @param bool $notificationsNewMessageBadgeCountEnabled The * notifications.new_message.badge_count_enabled * @param bool $notificationsAddedToChannelEnabled The * notifications.added_to_channel.enabled * @param string $notificationsAddedToChannelTemplate The * notifications.added_to_channel.template * @param string $notificationsAddedToChannelSound The * notifications.added_to_channel.sound * @param bool $notificationsRemovedFromChannelEnabled The * notifications.removed_from_channel.enabled * @param string $notificationsRemovedFromChannelTemplate The * notifications.removed_from_channel.template * @param string $notificationsRemovedFromChannelSound The * notifications.removed_from_channel.sound * @param bool $notificationsInvitedToChannelEnabled The * notifications.invited_to_channel.enabled * @param string $notificationsInvitedToChannelTemplate The * notifications.invited_to_channel.template * @param string $notificationsInvitedToChannelSound The * notifications.invited_to_channel.sound * @param string $preWebhookUrl The pre_webhook_url * @param string $postWebhookUrl The post_webhook_url * @param string $webhookMethod The webhook_method * @param string[] $webhookFilters The webhook_filters * @param int $limitsChannelMembers The limits.channel_members * @param int $limitsUserChannels The limits.user_channels * @param string $mediaCompatibilityMessage The media.compatibility_message * @param int $preWebhookRetryCount The pre_webhook_retry_count * @param int $postWebhookRetryCount The post_webhook_retry_count * @param bool $notificationsLogEnabled The notifications.log_enabled * @return UpdateServiceOptions Options builder */ public static function update(string $friendlyName = Values::NONE, string $defaultServiceRoleSid = Values::NONE, string $defaultChannelRoleSid = Values::NONE, string $defaultChannelCreatorRoleSid = Values::NONE, bool $readStatusEnabled = Values::NONE, bool $reachabilityEnabled = Values::NONE, int $typingIndicatorTimeout = Values::NONE, int $consumptionReportInterval = Values::NONE, bool $notificationsNewMessageEnabled = Values::NONE, string $notificationsNewMessageTemplate = Values::NONE, string $notificationsNewMessageSound = Values::NONE, bool $notificationsNewMessageBadgeCountEnabled = Values::NONE, bool $notificationsAddedToChannelEnabled = Values::NONE, string $notificationsAddedToChannelTemplate = Values::NONE, string $notificationsAddedToChannelSound = Values::NONE, bool $notificationsRemovedFromChannelEnabled = Values::NONE, string $notificationsRemovedFromChannelTemplate = Values::NONE, string $notificationsRemovedFromChannelSound = Values::NONE, bool $notificationsInvitedToChannelEnabled = Values::NONE, string $notificationsInvitedToChannelTemplate = Values::NONE, string $notificationsInvitedToChannelSound = Values::NONE, string $preWebhookUrl = Values::NONE, string $postWebhookUrl = Values::NONE, string $webhookMethod = Values::NONE, array $webhookFilters = Values::ARRAY_NONE, int $limitsChannelMembers = Values::NONE, int $limitsUserChannels = Values::NONE, string $mediaCompatibilityMessage = Values::NONE, int $preWebhookRetryCount = Values::NONE, int $postWebhookRetryCount = Values::NONE, bool $notificationsLogEnabled = Values::NONE): UpdateServiceOptions { return new UpdateServiceOptions($friendlyName, $defaultServiceRoleSid, $defaultChannelRoleSid, $defaultChannelCreatorRoleSid, $readStatusEnabled, $reachabilityEnabled, $typingIndicatorTimeout, $consumptionReportInterval, $notificationsNewMessageEnabled, $notificationsNewMessageTemplate, $notificationsNewMessageSound, $notificationsNewMessageBadgeCountEnabled, $notificationsAddedToChannelEnabled, $notificationsAddedToChannelTemplate, $notificationsAddedToChannelSound, $notificationsRemovedFromChannelEnabled, $notificationsRemovedFromChannelTemplate, $notificationsRemovedFromChannelSound, $notificationsInvitedToChannelEnabled, $notificationsInvitedToChannelTemplate, $notificationsInvitedToChannelSound, $preWebhookUrl, $postWebhookUrl, $webhookMethod, $webhookFilters, $limitsChannelMembers, $limitsUserChannels, $mediaCompatibilityMessage, $preWebhookRetryCount, $postWebhookRetryCount, $notificationsLogEnabled); } } class UpdateServiceOptions extends Options { /** * @param string $friendlyName The friendly_name * @param string $defaultServiceRoleSid The default_service_role_sid * @param string $defaultChannelRoleSid The default_channel_role_sid * @param string $defaultChannelCreatorRoleSid The * default_channel_creator_role_sid * @param bool $readStatusEnabled The read_status_enabled * @param bool $reachabilityEnabled The reachability_enabled * @param int $typingIndicatorTimeout The typing_indicator_timeout * @param int $consumptionReportInterval The consumption_report_interval * @param bool $notificationsNewMessageEnabled The * notifications.new_message.enabled * @param string $notificationsNewMessageTemplate The * notifications.new_message.template * @param string $notificationsNewMessageSound The * notifications.new_message.sound * @param bool $notificationsNewMessageBadgeCountEnabled The * notifications.new_message.badge_count_enabled * @param bool $notificationsAddedToChannelEnabled The * notifications.added_to_channel.enabled * @param string $notificationsAddedToChannelTemplate The * notifications.added_to_channel.template * @param string $notificationsAddedToChannelSound The * notifications.added_to_channel.sound * @param bool $notificationsRemovedFromChannelEnabled The * notifications.removed_from_channel.enabled * @param string $notificationsRemovedFromChannelTemplate The * notifications.removed_from_channel.template * @param string $notificationsRemovedFromChannelSound The * notifications.removed_from_channel.sound * @param bool $notificationsInvitedToChannelEnabled The * notifications.invited_to_channel.enabled * @param string $notificationsInvitedToChannelTemplate The * notifications.invited_to_channel.template * @param string $notificationsInvitedToChannelSound The * notifications.invited_to_channel.sound * @param string $preWebhookUrl The pre_webhook_url * @param string $postWebhookUrl The post_webhook_url * @param string $webhookMethod The webhook_method * @param string[] $webhookFilters The webhook_filters * @param int $limitsChannelMembers The limits.channel_members * @param int $limitsUserChannels The limits.user_channels * @param string $mediaCompatibilityMessage The media.compatibility_message * @param int $preWebhookRetryCount The pre_webhook_retry_count * @param int $postWebhookRetryCount The post_webhook_retry_count * @param bool $notificationsLogEnabled The notifications.log_enabled */ public function __construct(string $friendlyName = Values::NONE, string $defaultServiceRoleSid = Values::NONE, string $defaultChannelRoleSid = Values::NONE, string $defaultChannelCreatorRoleSid = Values::NONE, bool $readStatusEnabled = Values::NONE, bool $reachabilityEnabled = Values::NONE, int $typingIndicatorTimeout = Values::NONE, int $consumptionReportInterval = Values::NONE, bool $notificationsNewMessageEnabled = Values::NONE, string $notificationsNewMessageTemplate = Values::NONE, string $notificationsNewMessageSound = Values::NONE, bool $notificationsNewMessageBadgeCountEnabled = Values::NONE, bool $notificationsAddedToChannelEnabled = Values::NONE, string $notificationsAddedToChannelTemplate = Values::NONE, string $notificationsAddedToChannelSound = Values::NONE, bool $notificationsRemovedFromChannelEnabled = Values::NONE, string $notificationsRemovedFromChannelTemplate = Values::NONE, string $notificationsRemovedFromChannelSound = Values::NONE, bool $notificationsInvitedToChannelEnabled = Values::NONE, string $notificationsInvitedToChannelTemplate = Values::NONE, string $notificationsInvitedToChannelSound = Values::NONE, string $preWebhookUrl = Values::NONE, string $postWebhookUrl = Values::NONE, string $webhookMethod = Values::NONE, array $webhookFilters = Values::ARRAY_NONE, int $limitsChannelMembers = Values::NONE, int $limitsUserChannels = Values::NONE, string $mediaCompatibilityMessage = Values::NONE, int $preWebhookRetryCount = Values::NONE, int $postWebhookRetryCount = Values::NONE, bool $notificationsLogEnabled = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; $this->options['readStatusEnabled'] = $readStatusEnabled; $this->options['reachabilityEnabled'] = $reachabilityEnabled; $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; $this->options['consumptionReportInterval'] = $consumptionReportInterval; $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; $this->options['notificationsNewMessageSound'] = $notificationsNewMessageSound; $this->options['notificationsNewMessageBadgeCountEnabled'] = $notificationsNewMessageBadgeCountEnabled; $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; $this->options['notificationsAddedToChannelSound'] = $notificationsAddedToChannelSound; $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; $this->options['notificationsRemovedFromChannelSound'] = $notificationsRemovedFromChannelSound; $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; $this->options['notificationsInvitedToChannelSound'] = $notificationsInvitedToChannelSound; $this->options['preWebhookUrl'] = $preWebhookUrl; $this->options['postWebhookUrl'] = $postWebhookUrl; $this->options['webhookMethod'] = $webhookMethod; $this->options['webhookFilters'] = $webhookFilters; $this->options['limitsChannelMembers'] = $limitsChannelMembers; $this->options['limitsUserChannels'] = $limitsUserChannels; $this->options['mediaCompatibilityMessage'] = $mediaCompatibilityMessage; $this->options['preWebhookRetryCount'] = $preWebhookRetryCount; $this->options['postWebhookRetryCount'] = $postWebhookRetryCount; $this->options['notificationsLogEnabled'] = $notificationsLogEnabled; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The default_service_role_sid * * @param string $defaultServiceRoleSid The default_service_role_sid * @return $this Fluent Builder */ public function setDefaultServiceRoleSid(string $defaultServiceRoleSid): self { $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; return $this; } /** * The default_channel_role_sid * * @param string $defaultChannelRoleSid The default_channel_role_sid * @return $this Fluent Builder */ public function setDefaultChannelRoleSid(string $defaultChannelRoleSid): self { $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; return $this; } /** * The default_channel_creator_role_sid * * @param string $defaultChannelCreatorRoleSid The * default_channel_creator_role_sid * @return $this Fluent Builder */ public function setDefaultChannelCreatorRoleSid(string $defaultChannelCreatorRoleSid): self { $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; return $this; } /** * The read_status_enabled * * @param bool $readStatusEnabled The read_status_enabled * @return $this Fluent Builder */ public function setReadStatusEnabled(bool $readStatusEnabled): self { $this->options['readStatusEnabled'] = $readStatusEnabled; return $this; } /** * The reachability_enabled * * @param bool $reachabilityEnabled The reachability_enabled * @return $this Fluent Builder */ public function setReachabilityEnabled(bool $reachabilityEnabled): self { $this->options['reachabilityEnabled'] = $reachabilityEnabled; return $this; } /** * The typing_indicator_timeout * * @param int $typingIndicatorTimeout The typing_indicator_timeout * @return $this Fluent Builder */ public function setTypingIndicatorTimeout(int $typingIndicatorTimeout): self { $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; return $this; } /** * The consumption_report_interval * * @param int $consumptionReportInterval The consumption_report_interval * @return $this Fluent Builder */ public function setConsumptionReportInterval(int $consumptionReportInterval): self { $this->options['consumptionReportInterval'] = $consumptionReportInterval; return $this; } /** * The notifications.new_message.enabled * * @param bool $notificationsNewMessageEnabled The * notifications.new_message.enabled * @return $this Fluent Builder */ public function setNotificationsNewMessageEnabled(bool $notificationsNewMessageEnabled): self { $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; return $this; } /** * The notifications.new_message.template * * @param string $notificationsNewMessageTemplate The * notifications.new_message.template * @return $this Fluent Builder */ public function setNotificationsNewMessageTemplate(string $notificationsNewMessageTemplate): self { $this->